PostHog / PostHog/posthog-flutter
Feature request: Support on-demand or realtime feature flag updates (avoid stale cached experiment values)
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 97
- Forks
- 85
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 31
Description
Problem Statement
Hi PostHog team,
We are using posthog-flutter and are running into an experiment/feature-flag refresh issue.
Problem
Our flow is:
- We fetch all feature flags on app start (it has some crucial info to run app).
- We run an experiment whose assignment is effectively needed later (after a specific tracked event / later user state).
- Until reassignment/evaluation happens, we keep getting the default/cached feature flag value.
- The experiment variant is not updated unless we manually reload ALL flags.
Right now, the only relatively (not really sure because of this https://github.com/PostHog/posthog-flutter/issues/241) reliable way we found is:
await Posthog().reloadFeatureFlags();
Is manual reloadFeatureFlags() the only supported approach in Flutter for this case?
Solution Brainstorm
- Method to fetch a new value for only one specific flag,
- or real-time feature flags updates similar to how it works in Firebase.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Posthog().reloadFeatureFlags() and the behavior discussed in issue #241. Compare that flow with the delayed experiment-assignment scenario described here, then determine the intended scope between per-flag fetching and realtime updates. Done means the supported refresh behavior is clearly defined and validated for later user-state changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100