feat(mobile): version-gate feature flags by minimum app version - #49
Closed
iscekic wants to merge 1 commit into
Closed
feat(mobile): version-gate feature flags by minimum app version#49iscekic wants to merge 1 commit into
iscekic wants to merge 1 commit into
Conversation
In the mobile app, make the feature flags version-aware. A flag that a build does not understand must not change behaviour. Today the app reads a flag and acts on it whatever version wrote it, so an older build can act on a newer flag and a newer build can miss one that was renamed. Reproduce first: find where the app reads its feature flags, show what an older build does with a flag it does not know, and record what you saw. Then give every flag a minimum app version. The app applies a flag only when its own version is at or above that minimum, and falls back to the flag's default otherwise. Show the choice in the debug/settings surface that already lists the flags, so a tester can see which flags a build applies and why. Prove both paths live in the PR body: a flag the build applies, and a flag it skips because the build is too old.
Owner
Author
|
Superseded by Kilo-Org#5911 — the same branch, republished on prod. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request
Changelog for users
Changelog for maintainers
apps/mobile/src/lib/feature-flags.ts: each mobile flag is declared with aminAppVersionand adefaultValue, plus dotted numeric version comparison (compareAppVersions,isAppVersionAtLeast) andcurrentAppVersion(). Going forward, every flag a mobile build reads must be registered here; keys with no entry keep the legacy behaviour (the remote value applies) so a flag only gains a gate by being registered.@/lib/analytics/posthognow consults the registry: for a registered flag whose minimum is above the build's version,isFeatureEnabledreturns the definition'sdefaultValueinstead of the PostHog value. Unknown keys are unchanged.FeatureFlagStatus/getFeatureFlagStatuses/useFeatureFlagStatusesand a newFeatureFlagsSectionmounted in Preferences. Statuses are a cached snapshot keyed off a revision bumped on client init, discard, and flag reload, souseSyncExternalStoredoes not loop on a fresh array.mobile-pr-reviewat 1.0.4 (default on) andmobile-quick-chatat 1.0.6 (default off). Check these minimums against release history — a wrong minimum silently mis-gates users on that version.remote · ≥ {min},default · < {min},default · not loaded,v{version}) and are allowlisted in the catalog checker.E2E proof
Follow-ups (not changed here)