Repository navigation
fix(feature-flags): Keep polling when no error listener is attached - #1728
Open
stanleyphu wants to merge 2 commits into
Open
stanleyphu wants to merge 2 commits into
stanleyphu wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review this draft |
stanleyphu
marked this pull request as ready for review
October 19, 2026 22:53
stanleyphu
requested review from
Deborah-Digges and
hadihallak
and removed request for
hadihallak
October 19, 2026 22:53
Contributor
[Medium impact] The PR appears safe to merge, with no outstanding findings. SummaryKeeps background polling alive when no
The previous unnumbered finding is fixed: the 401 warning now says syncing stopped rather than promising retries. Reviews (2) · Last reviewed commit: "fix(feature-flags): Warn when a 401 stop..." · Reviewed by Greptile |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review |
gjtorikian
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A runtime client with no
errorlistener crashes the host process on its first failed poll.poll()runs from a timer, and emittingerrorwith nothing listening throws, because the emitter follows Node'sEventEmitter. The throw escapes as an unhandled rejection and skips the retry. On a 401 it also skipsfailedand thewaitUntilReady()rejection, so callers'try/catcharoundwaitUntilReady()never runs. #1630 called this out as a pre-existing follow-up. Every example in the runtime client docs except the events one creates a client without anerrorlistener, and so doesgetFeatureFlagsRuntimeClient()inauthkit-nextjs.erroronly when a listener is attached. With no listener and nologger, it warns once throughworkos.emitWarningand keeps retrying, so failures still aren't silent. A 401 always gets its own warning that syncing stopped, even after an earlier failure warned.failedfires, polling stops, andwaitUntilReady()rejects withUnauthorizedExceptionbefore initialization.client.emit('error')directly with no listener still throws.Merging this before the release PR (#1722) ships it in 12.0.0.
Not covered by CI
errorlistener,try/catcharoundwaitUntilReady()), against builds ofmainand this branch, with scripted API responses.main: polling stops after an unobserved failure,waitUntilReady()never rejects on a 401, and nothing warns. They pass here.Proof
🤖 Generated with Claude Code