Repository navigation
fix(chat): expire stale typing indicators locally - #1602
Merged
Merged
Conversation
The server relays typing best-effort with no timeout, and the delegate only removed a typist on STOPPED/TIMED_OUT. A lost STOPPED (sender backgrounded or killed, network drop, stream reconnect) left the indicator up for good. Typing state moves into TypingIndicatorTracker, matching iOS's ConversationTyping: each STARTED/STILL sets a 10s deadline while keeping the typist's original `since`, one job re-armed for the earliest deadline drops expired typists, the signed-in user's own notifications are ignored, and clearAll() drops every typist.
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.
A typing indicator could stay up in a chat indefinitely.
EventStreamDelegateadded a typist on STARTED/STILL and removed them only on STOPPED/TIMED_OUT, and nothing else ever wrotetypingIndicators. The server relays typing best-effort with no timeout of its own, so a STOPPED lost to a backgrounded or killed sender, a network drop, or a stream reconnect left the typist on screen. This showed up in the "Moony" group: Android kept an indicator up while iOS showed nothing for the same chat.iOS already expires typists locally (
ConversationTyping, code-payments/code-ios-app#475). This matches it:TypingIndicatorTracker, now the only writer ofChatState.typingIndicators.since, so a heartbeat no longer moves the typist to the back of the avatar row. Before this change every STILL restampedsince.clearAll()drops all typists and cancels the job.The tracker takes a
TimeSource, so the tests run on the test scheduler's virtual time.TypingIndicatorTrackerTestcovers expiry at 10s, STILL extending the deadline without reordering, STOPPED/TIMED_OUT removal, self filtering, independent expiry across typists and chats, andclear().EventStreamTypingTestchecks the delegate wiring.