fix: Separate the FDv2 source manager scan cursor from the active slot#304
Draft
kinyoklion wants to merge 1 commit into
Draft
fix: Separate the FDv2 source manager scan cursor from the active slot#304kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
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 fixes
Review findings against the source manager (#298) that were validated on the end-to-end branch but did not make it into the merged PR.
The core problem: the source manager used one index both as the rotation scan cursor and as "which slot is active." The two move independently — a recovery reset or FDv1-fallback engagement moves the cursor while a synchronizer is still running — so conflating them misreported
isPrimarySynchronizerand mis-targetedblockCurrentSynchronizerin those windows._synchronizerIndex, advanced bynextAvailableSynchronizer, reset by recovery/fallback) is now separate from_activeSlotIndex(the slot of the synchronizer that is actually running, null when none is).isPrimarySynchronizerandblockCurrentSynchronizerread the active slot, not the cursor.nextInitializer()exhaustion closes the last active source, so a terminal null leaves nothing running.engageFdv1Fallback()closes the active source and returns early when no FDv1 fallback slot is configured.hasFdv1FallbackConfiguredreplaces the previous name to say what it checks.Testing
New tests pin each behavior: the active slot tracking across recovery resets and fallback engagement, primary detection while the cursor has moved, blocking targeting the running synchronizer, exhaustion closing the final source, and fallback engagement without a configured FDv1 slot. Full package suite passes.
SDK-2186