Repository navigation
fix: Complete a pending identify or start with an error when the client closes - #347
Draft
jsonbailey wants to merge 1 commit into
Draft
jsonbailey wants to merge 1 commit into
jsonbailey wants to merge 1 commit into
Conversation
jsonbailey
commented
Oct 16, 2026
| /// | ||
| /// A pending [start] completes with false, and a pending [identify] | ||
| /// completes with [IdentifyError]. | ||
| Future<void> close() async { |
Author
There was a problem hiding this comment.
Cross-SDK note, for team discussion: iOS and Android both leave a pending identify waiting after close. On iOS, internalClose goes offline without calling the completion. On Android, ConnectivityManager.shutDown stops the data source with a no-op callback. Flutter completes it with IdentifyError("The client was closed before the identify completed."), so that code awaiting identify without a timeout does not wait forever.
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
If
close()was called whileidentify()orstart()was still waiting for flag data, the returned future never completed. Code that awaited it with no timeout waited forever.identify()completes withIdentifyError("The client was closed before the identify completed."), and a pendingstart()completes withfalse.IdentifyError,close(),identify()andstart()docs describe the close behavior.