[PM-39807] fix: Gate fill-assist rules sync on user settings#7123
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR gates Code Review Details
|
| if (!featureFlagManager.getFeatureFlag(FlagKey.FillAssistTargetingRules) || | ||
| !settingsRepository.isFillAssistEnabled | ||
| ) { | ||
| return | ||
| } |
There was a problem hiding this comment.
❓ QUESTION: Is the writer for isFillAssistEnabled intentionally deferred to a follow-up PR?
Details
This change gates syncIfNecessary() on settingsRepository.isFillAssistEnabled, but nothing in production code ever sets that property to true. Across the codebase it is only: defined here, defaulted to false (getter returns false when unset), and cleared to null on logout. The parallel isInlineAutofillEnabled setting, by contrast, has a writer in AutoFillViewModel (AutoFillViewModel.kt:248).
As written, the gate will always be false, so fill-assist rules will never be fetched even when the FillAssistTargetingRules flag is on. If the settings toggle that flips this on lands in a later PR, this is fine; if not, the feature is effectively disabled. Confirming intent here.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7123 +/- ##
==========================================
+ Coverage 86.39% 86.78% +0.39%
==========================================
Files 884 909 +25
Lines 64383 65356 +973
Branches 9337 9353 +16
==========================================
+ Hits 55622 56719 +1097
+ Misses 5538 5412 -126
- Partials 3223 3225 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
thanks @david-livefront |
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-39807
📔 Objective
FillAssistManagerImpl.syncIfNecessary()was fetching fill-assist targeting rules from the server as soon as the server config became available and theFillAssistTargetingRulesfeature flag was enabled — regardless of whether the user had opted into fill assist in their settings.This PR gates the sync behind
settingsRepository.isFillAssistEnabled, so rules are only fetched once the user explicitly enables fill assist. The check is short-circuited alongside the existing feature-flag guard insyncIfNecessary().Changes:
var isFillAssistEnabled: BooleantoSettingsRepository/SettingsRepositoryImpl, backed by a newgetFillAssistEnabled/storeFillAssistEnabledpair inSettingsDiskSource/SettingsDiskSourceImplsettingsRepository: SettingsRepositorytoFillAssistManagerImplandFillAssistModulesyncIfNecessary()to return early whenisFillAssistEnabledisfalse