mirror of
https://github.com/vercel/flags.git
synced 2026-09-19 03:49:23 +08:00
8b8c3553a5
The adapter had no shutdown mechanism. close() now reverts it to its uninitialized state, so the next evaluation initializes it again, per section 2.5 of the OpenFeature provider spec. It first awaits an initialization that is still in flight, so the client that initialization produces is disposed rather than leaked, and it is idempotent. Provider disposal is opt-in through the new onClose option, because the adapter cannot do it on its own: an OpenFeature client has no close of its own, and shutting down providers means closing them on the global OpenFeature API, which would also affect providers this adapter never registered. Follow-up to #474, which fixed #473. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>