Skip to content

chore: remove fully rolled-out and dead feature flags - #14780

Open
dylanjeffers wants to merge 1 commit into
mainfrom
chore/remove-dead-feature-flags
Open

dylanjeffers wants to merge 1 commit into
mainfrom
chore/remove-dead-feature-flags

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Removes 9 feature flags and 3 remote-config keys that are either fully rolled out or no longer read anywhere. Behavior is unchanged for production users, with the exceptions listed under Behavior notes.

How each flag was judged

Rollout state comes from the live production Optimizely datafile (revision 3221, fetched from the public CDN with the prod SDK key in env.prod.ts), not from the code defaults. Age comes from git history. I searched every local Audius repo (api, identity, protocol, etc.) for each key; none of the removed keys are read outside this repo.

Flag Prod rollout Call sites Why it's removed
react_query_sync everyone, 100% 0 Dead: defined but never read
collapsed_explore_header everyone, 100% 0 Dead: defined but never read
verify_handle_with_twitter everyone, 100% 2 Fully rolled out, ≥ 10 months old
verify_handle_with_instagram everyone, 100% 2 Fully rolled out (see note: the lookup is a stub)
verify_handle_with_tiktok everyone, 100% 2 Fully rolled out (see note: the lookup is a stub)
network_cut_enabled everyone, 100% 3 Fully rolled out, ≥ 10 months old
fast_referral everyone, 100% 2 Fully rolled out, ≥ 10 months old
launchpad_verification everyone, 100% 2 Fully rolled out, ≥ 10 months old
fan_club_text_post_posting everyone, 100% 3 Fully rolled out, ~7 months old

Each removal inlines the enabled branch and deletes the flag's definition, prod default and any dev override.

Remote-config keys removed (no readers since the Feb rewards UI update, missed by #14671): TRENDING_REWARD_IDS, REWARDS_TWEET_ID_TRACKS, REWARDS_TWEET_ID_UNDERGROUND.

Behavior notes

  • Startup window. Until Optimizely loads, getFeatureEnabled returns the code default, which was false for most of these flags. Inlining them means they're also on during the first moments after launch, matching steady-state production.
  • network_cut_enabled is on the payment path. All 8 includeNetworkCut call sites in purchase-content/sagas.ts now pass true. Production already sends true for everyone; the one change is that a purchase started before Optimizely finished loading would previously have left out the network cut. I kept the includeNetworkCut parameter rather than changing transaction helper signatures. Please review this file closely.
  • Handle verification: the Instagram and TikTok lookups (AudiusBackend.instagramHandle / tiktokHandle) are stubs that always resolve null, so only the Twitter check can reserve a handle. Removing the flags exposed this to the type checker; I replaced the impossible casts with ?? null and left a comment. Not changed here.
  • In signon/sagas.ts the three lookups now use all({...}) (object form) instead of all([...]), so each result keeps its own type. Same runtime behavior.

Kept on purpose (worth a follow-up)

Flag Why it stays
usdc_purchases Audience-targeted (an "IOS App Review" rule is meant to turn it off). See the bug below.
feature_flag_access Internal-only audience
buy_with_coinflow, coinflow_offramp_enabled Gated by mobile app version; web clients don't send that attribute
queue_new_feature_badge Running 50% rollout
weekly_rotation, now_playing_comments, now_playing_waveform, and everything added Oct–Nov 2026 Under ~10 weeks old; several are still dark or ramping, and recent launches are where a kill switch matters most

⚠️ Bug found during the audit (not fixed here)

getFeatureEnabled evaluates (isFeatureEnabled(flag) || (fallbackFlag && …)) ?? defaultVal. Without a fallback flag, an Optimizely false becomes undefined, which falls through to the code default. So Optimizely can never turn off a flag whose code default is true:

  • usdc_purchases: the "IOS App Review: 0% on" rule has no effect.
  • weekly_rotation, now_playing_comments, now_playing_waveform: commented as "the remote flag is the kill switch", but they can't be killed remotely.

Fixing this changes live behavior (the iOS review gate would start working), so it should be its own reviewed change. It's filed as a separate task.

Not in this PR

The flags still exist in Optimizely. Once this ships and older app versions have aged out, they can be archived there.

Verification

  • tsc --noEmit for common, web, mobile: no new errors. The only error is an existing one on main in useScheduledReleaseLabels.test.ts, which this PR doesn't touch.
  • eslint on every changed file: clean.
  • git grep confirms no remaining references to any removed flag or key.
  • Not exercised in a running app.

🤖 Generated with Claude Code

Removes 9 feature flags that are at 100% for everyone in the production
Optimizely datafile or are never read, inlining their enabled branches:
verify_handle_with_{twitter,instagram,tiktok}, network_cut_enabled,
fast_referral, launchpad_verification, fan_club_text_post_posting,
react_query_sync and collapsed_explore_header.

Also drops three remote-config string keys with no readers:
TRENDING_REWARD_IDS, REWARDS_TWEET_ID_TRACKS and
REWARDS_TWEET_ID_UNDERGROUND.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 49273b4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant