Closed paularmstrong closed 7 months ago
@paularmstrong sorry about that.
The retry is configurable, see the options: https://github.com/PostHog/posthog-js-lite/blob/c59c9d6b13bc972e0b1b3b66fe7a6c6a0e22f0ab/posthog-core/src/types.ts#L23-L28
I made a PR to improve the default values and fix a typo https://github.com/PostHog/posthog-js-lite/pull/196 or https://github.com/PostHog/posthog-js-lite/blob/c59c9d6b13bc972e0b1b3b66fe7a6c6a0e22f0ab/posthog-node/src/posthog-node.ts#L20-L23
but the logic for node
is different, @neilkakkar maybe can you confirm if that's the case?
It should be the same, uses the same base class 👍
To follow up, I'll add more sensible defaults for flags, since indeed this needs to be fast and ok not to retry, vs, say, sending events to posthog
Bug description
There is currently an outage on the posthog service side for feature flags. This is causing my server to thrash – continually logging network errors when trying to call
posthog.getAllFlags()
This is caused by
fetchWithRetry
, which by default calls 4 times, with a 5 second delay between each call, resulting in requests on the server stalling for 20+ seconds: https://github.com/PostHog/posthog-js-lite/blob/c59c9d6b13bc972e0b1b3b66fe7a6c6a0e22f0ab/posthog-core/src/index.ts#L295This retry is not configurable from the
getAllFlags()
endpoint (or any others that I'm seeing)How to reproduce
posthog.getAllFlags()
Related sub-libraries
Additional context
Thank you for your bug report – we love squashing them!