PostHog / PostHog/posthog-flutter

Feature request: Support on-demand or realtime feature flag updates (avoid stale cached experiment values)

Open
#387 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Experiments Feature flags
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:

  1. We fetch all feature flags on app start (it has some crucial info to run app).
  2. We run an experiment whose assignment is effectively needed later (after a specific tracked event / later user state).
  3. Until reassignment/evaluation happens, we keep getting the default/cached feature flag value.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.