You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to use PostHog feature flags within a WebWorker. However, when I try to access a feature flag (e.g., ab-checklist), the PostHog JavaScript API returns an incorrect value.
Additionally, when I use the posthog.onFeatureFlags() method, it triggers an endless loop, continuously returning the wrong value for the feature flag.
This issue only occurs when a Release Condition is specified (as shown in the screenshot below). If I remove the Release Condition, the correct value is returned, but the loop still persists.
Posthog Config Screenshot and Repo for reproducing issue:
Install the required dependencies by running the following command:
npm install
Add your PostHog key and UserID in the env.ts file.
Start the application with:
npm start
If you open the console, you should notice that the logs in worker.ts (line 27) are being called repeatedly.
This issue does not occur in the main thread (index.ts); it only appears in the WebWorker thread. Additionally, the values logged are incorrect. They are correct the first time the onFeatureFlags callback is triggered but then get overwritten with incorrect values.
I expect to receive the value test from PostHog, but instead, I am getting either control or false.
The text was updated successfully, but these errors were encountered:
Issue Description
I am attempting to use PostHog feature flags within a WebWorker. However, when I try to access a feature flag (e.g.,
ab-checklist
), the PostHog JavaScript API returns an incorrect value.Additionally, when I use the
posthog.onFeatureFlags()
method, it triggers an endless loop, continuously returning the wrong value for the feature flag.This issue only occurs when a Release Condition is specified (as shown in the screenshot below). If I remove the Release Condition, the correct value is returned, but the loop still persists.
Posthog Config Screenshot and Repo for reproducing issue:
https://github.com/Dario91/posthog_issue2
Reademe.md with screenshots:
https://github.com/Dario91/posthog_issue2/blob/master/readme.md
Steps to Reproduce
Install the required dependencies by running the following command:
Add your
PostHog key
andUserID
in theenv.ts
file.Start the application with:
If you open the console, you should notice that the logs in
worker.ts
(line 27) are being called repeatedly.This issue does not occur in the main thread (
index.ts
); it only appears in the WebWorker thread. Additionally, the values logged are incorrect. They are correct the first time theonFeatureFlags
callback is triggered but then get overwritten with incorrect values.I expect to receive the value
test
from PostHog, but instead, I am getting eithercontrol
orfalse
.The text was updated successfully, but these errors were encountered: