Skip to content

Feature flag experience continuity bug (iOS, Android, Flutter, likely React Native) #456

@ioannisj

Description

@ioannisj

Ticket: https://posthoghelp.zendesk.com/agent/tickets/45321

Users get re-bucketed after identify() despite "Persist flag across authentication" being enabled.

There seems to be a race condition: when preloadFeatureFlags (default: true) is in flight and user calls identify(), the subsequent reloadFeatureFlags() is dropped instead of queued.

iOS - PostHogRemoteConfig.swift:266-271
Android - PostHogRemoteConfig.kt:341-344

Both have:

if loadingFeatureFlags {
   return  // ← Dropped, never sends $anon_distinct_id
}

First request completes without $anon_distinct_id → server never stores hash key override → user re-bucketed.

A potential fix is to queue pending reload instead of dropping:

if loadingFeatureFlags {
   pendingFlagsReload = true  // ← Queue it
  return
}
// After request completes, check pendingFlagsReload and retry
  • iOS
  • Android
  • Flutter (bump min native versions when completed)
  • React Native

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions