Files
Dominik Ferber a2f7367671 [flags-core] re-wire source events when a source restarts
shutdown() unwires the stream and polling event handlers, but nothing
wired them again. A client initialized after a shutdown opened a new
connection and then ignored every datafile that connection delivered, so
evaluations returned the default value with an error reason. The failure
was silent: the socket was healthy and the fetch happened, only the
handlers were missing.

wireSourceEvents() now runs at the start of tryInitializeStream() and
tryInitializePolling(), the only two places that start a source. Repeat
calls cannot duplicate a subscription, because the handlers are stable
instance properties and TypedEmitter keeps them in a Set. Two tests cover
that invariant: one across a shutdown, and one for a source that starts
twice within a single lifecycle, which happens when a failed
initialization is followed by an evaluation.

This also affects the VercelProvider OpenFeature provider, whose
onClose() hook shuts the client down, since section 2.5.2 of the provider
spec allows a provider to be initialized again after it is closed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 08:46:52 +03:00
..
2026-08-12 08:39:34 +02:00
2026-08-04 19:12:09 +02:00
2026-08-04 19:12:09 +02:00
2026-08-12 08:39:34 +02:00
2026-07-27 10:32:21 -04:00
2026-08-04 19:12:09 +02:00