Skip to content

Use a fresh Firebase Remote Config key for the account-creation flag - #5029

Merged
yaelirub merged 2 commits into
trunkfrom
fix/eac-fresh-remote-config-key
Aug 27, 2026
Merged

Use a fresh Firebase Remote Config key for the account-creation flag#5029
yaelirub merged 2 commits into
trunkfrom
fix/eac-fresh-remote-config-key

Conversation

@yaelirub

Copy link
Copy Markdown
Contributor

Follow-up to #4985.

The encourageAccountCreation flag's remoteKey fell through to the derived "encourage_account_creation". That Firebase Remote Config parameter still exists from the 2025 one-shot Encourage Account Creation experiment — removing code never removed the parameter — so the recurring modal inherits whatever value that entry currently holds.

Because a remote value overrides the flag's local default, the recurring modal could ship silently disabled (if the old experiment was wound down to false) or at an unintended partial rollout percentage, while the code still reads as "default on".

This points the flag at a fresh parameter, encourage_account_creation_recurring, so it starts from a clean slate with no inherited value or rollout condition.

Caught by @geekygecko on the Android port (pocket-casts-android#5763); the same rename has landed there, so both platforms move off the stale parameter together.

Deliberately not renamed: the identically-named AnalyticsSource.encourageAccountCreation (Constants.swift) and OnboardingFlow.Flow.encourageAccountCreation (OnboardingFlow.swift) string values. Those are analytics/flow identifiers, not Remote Config keys — renaming them would break analytics continuity and cross-platform parity.

To test

This is a Remote Config plumbing change; the observable behaviour is which parameter the flag reads.

  1. Beta Features screen → confirm the Encourage Account Creation flag still appears and its dev toggle works as before.
  2. With the flag on, confirm the recurring modal still shows for a logged-out user past onboarding (unchanged behaviour from Show Encourage Account Creation modal every 60 days for logged-out users #4985).
  3. Before enabling remotely, a new encourage_account_creation_recurring parameter needs creating in Firebase Remote Config — the old encourage_account_creation entry is now unused by this flag.

make build_staging succeeds locally.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

🤖 Generated with Claude Code

remoteKey previously fell through to the derived
"encourage_account_creation", which is still a live Remote Config
parameter from the 2025 one-shot experiment. Its stale value would
override the flag's default, so the recurring modal could ship silently
disabled or partially rolled out.

Point the flag at "encourage_account_creation_recurring" for a clean
slate. The identically-named analytics source and onboarding flow
identifiers are intentionally unchanged — renaming those would break
analytics continuity and cross-platform parity.

Matches the same rename on Android (pocket-casts-android#5763).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 27, 2026 22:26
@yaelirub
yaelirub requested a review from a team as a code owner August 27, 2026 22:26
@yaelirub
yaelirub requested review from kean and removed request for a team August 27, 2026 22:26
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @yaelirub's task in 1m 59s —— View job


Review

The mapping does what the description claims: remoteKey is the single accessor used both to register defaults (podcasts/FirebaseManager.swift:19-21) and to read values (podcasts/AppDelegate.swift:306-317), so pointing the flag at encourage_account_creation_recurring moves both sides together, and the derived key would indeed have been encourage_account_creation (lowerSnakeCased() in Modules/Sources/PocketCastsUtils/Extensions/StringExtension.swift:66). With the new parameter absent from Firebase, configValue resolves to .default, no override is written, and the flag reads its local true. No correctness or behaviour issues in the diff; one operational caveat below.

Non-blocking

Modules/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift:462 — an override already persisted on device survives the rename, since FeatureFlagOverrideStore keys on the flag name, not the remote key; publish the new parameter with an explicit true so one fetch clears any stale false from builds that read the old key. (thread)
· branch fix/eac-fresh-remote-config-key

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the iOS feature-flag plumbing so the Encourage Account Creation recurring-modal gate reads from a new Firebase Remote Config parameter, avoiding unintended inheritance from the stale 2025 one-shot experiment key.

Changes:

  • Adds an explicit remoteKey mapping for FeatureFlag.encourageAccountCreation.
  • Points that mapping to the new Remote Config parameter name: encourage_account_creation_recurring.
  • Leaves analytics/flow identifier strings untouched (as intended) to preserve continuity.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

case .encourageAccountCreation:
// Not the derived "encourage_account_creation" — that Firebase parameter still exists
// from the 2025 one-shot experiment, and its stale value would override the default.
"encourage_account_creation_recurring"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(non-blocking) The key rename fixes future reads, but it can't undo an override already persisted on device: AppDelegate.updateRemoteFeatureFlags (podcasts/AppDelegate.swift:306-317) writes ff-override-encourageAccountCreation into UserDefaults whenever the remote value's source is .remote, and that store is keyed by the flag's description (the raw value), not by the remote key. So any tester who ran a build containing #4985 while encourage_account_creation was serving false still has a stored false, and because the new encourage_account_creation_recurring parameter doesn't exist yet its configValue source is .default — the override block is skipped and nothing clears it. Those users keep the modal disabled.

Easiest mitigation: when creating encourage_account_creation_recurring in Firebase, publish it with an explicit true rather than leaving it absent — override(_:withValue:) deletes the stored key when the incoming value matches the flag default, so one remote fetch cleans the stale entry.

@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @yaelirub's task in 17s —— View job


Review

Since my last review the only change is ddf8bea, which drops the two explanatory comment lines above the new case; the mapping itself is byte-identical, so nothing new to flag.

Non-blocking

Modules/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift:459 — still open from the previous pass: publish encourage_account_creation_recurring with an explicit true so one fetch clears any false override already persisted on devices that ran an earlier build. (thread)

--- · branch fix/eac-fresh-remote-config-key

@yaelirub yaelirub added this to the 8.20 milestone Aug 27, 2026

@kean kean left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@yaelirub
yaelirub merged commit 3b27afc into trunk Aug 27, 2026
8 checks passed
@yaelirub
yaelirub deleted the fix/eac-fresh-remote-config-key branch August 27, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants