Repository navigation
fix: Prevent the data source status from changing after the client closes - #346
Draft
jsonbailey wants to merge 4 commits into
Draft
jsonbailey wants to merge 4 commits into
jsonbailey wants to merge 4 commits into
Conversation
jsonbailey
added this pull request to stack #353
October 16, 2026 06:33
jsonbailey
commented
Oct 16, 2026
| @@ -230,6 +241,7 @@ final class DataSourceManager { | |||
|
|
|||
| void stop() { | |||
Author
There was a problem hiding this comment.
Cross-SDK note: same result as the other SDKs (no status change after close), different place. Android checks closed in its data sources, which works because they apply payloads and set status synchronously. Here the data source only emits events, and this class applies them asynchronously after persistence, so the guard has to be here. iOS has no status manager. A status-value latch (the server SDK approach) does not fit, because close sets no terminal state and the status manager outlives identify and mode changes.
This branch has not been deployed
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.
Summary
After
close(), work that started before the close can still finish. For example, a put that is still being stored callssetValid()when it completes. That changed the data source status and the last error on a client that was already closed.DataSourceManagerandDataSourceEventHandler, the code that sends status updates.DataSourceStatusManageris unchanged.stop()for put, FDv2 payload, patch and delete (success and failure), and for a queued status event.