fix: Close the final initializer on exhaustion; document the source manager contract#304
Merged
Merged
Conversation
d7b99a0 to
f0e7b5c
Compare
kinyoklion
commented
Jun 12, 2026
| /// activate. The active source keeps running until the next | ||
| /// activation closes it. | ||
| void engageFdv1Fallback() { | ||
| if (!hasFdv1FallbackConfigured) { |
Member
Author
There was a problem hiding this comment.
In practice we may not make this possible.
joker23
approved these changes
Jun 12, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Jun 29, 2026
🤖 I have created a release *beep* *boop* --- ## [1.14.0](launchdarkly_common_client-v1.13.0...launchdarkly_common_client-v1.14.0) (2026-06-29) ### Features * add an initial connection mode to the FDv2 data system config ([#318](#318)) ([5b980ab](5b980ab)) * Add FDv2 payload application via FlagManager.applyChanges ([#299](#299)) ([66c2554](66c2554)) * Add FDv2 payload handling to the data source event handler ([#305](#305)) ([761ed9d](761ed9d)) * Add FDv2 source manager ([#298](#298)) ([43d899e](43d899e)) * Add FDv2 streaming source factories and query-parameter authentication ([7b46ac6](7b46ac6)) * Add FDv2 synchronizer fallback and recovery conditions ([#297](#297)) ([17f7b4e](17f7b4e)) * Add the FDv2 data source orchestrator ([#307](#307)) ([eb9a35f](eb9a35f)) * Add the FDv2 data system and expose it through configuration ([#310](#310)) ([61a1e59](61a1e59)) * Centralize platform credential handling in CredentialConfig ([#300](#300)) ([c677c3d](c677c3d)) * honor the FDv1 fallback directive on success, error, and goodbye ([#312](#312)) ([1c35867](1c35867)) * Translate FDv2 payloads at the data source layer ([7b46ac6](7b46ac6)) * Update launchdarkly_event_source_client to version 2.2.0 ([#302](#302)) ([cb6a5c0](cb6a5c0)) * Update launchdarkly_event_source_client to version 3.0.0 ([#317](#317)) ([15861f8](15861f8)) ### Bug Fixes * Close the final initializer on exhaustion; document the source manager contract ([#304](#304)) ([b20c35e](b20c35e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and changelog metadata only; no application logic changes in the diff. > > **Overview** > Release Please bumps **`launchdarkly_common_client`** from **1.13.0** to **1.14.0** with no runtime code changes in this PR. > > Updates **`.release-please-manifest.json`**, **`packages/common_client/pubspec.yaml`**, and adds a **1.14.0** section to **`CHANGELOG.md`** that documents the FDv2 data system work, credential centralization, event-source client upgrades, and related fixes already merged on main. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 458f0b6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
What this changes
Two small behavior hardenings and an explicit statement of the source manager's API contract.
engageFdv1Fallback()is a no-op when no FDv1 fallback slot is configured. Blocking every slot without unblocking a fallback would leave nothing to activate. The orchestration layer checks before engaging; the guard makes the operation safe regardless of the caller.hasFdv1FallbackConfiguredreplaceshasFdv1Fallbackto make clear it reports configuration, not engagement state.The documented contract
The class docs now state the assumptions the manager operates under, so they are visible at the API surface rather than implicit in the call sites:
closecloses whatever remains.nextAvailableSynchronizer/recreateCurrentSynchronizer) until the next cursor mutation (resetSynchronizerIndex/engageFdv1Fallback), the cursor identifies the running synchronizer's slot —isPrimarySynchronizerandblockCurrentSynchronizerread it and are only meaningful inside that window. After mutating the cursor, a new synchronizer must be activated before consulting either. The driver satisfies this by construction: both reads happen strictly between an activation and the run's outcome being decided, and cursor mutations happen only after the outcome is decided.Testing
New tests pin the exhaustion close (a terminal null leaves no source running) and the fallback-engagement guard (engaging with no configured FDv1 slot leaves the slot list untouched). Full package suite passes.
SDK-2186