Repository navigation
handlematrix: don't block on RTM queue when sending typing - #128
Merged
Merged
Conversation
Fizzadar
marked this pull request as ready for review
October 27, 2026 11:36
Contributor
|
No issues found.
All required CI checks passed on
Select any unchecked box below to run or rerun that agent. Full resultsIndent Review Agent
|
tulir
reviewed
Oct 27, 2026
indent
Bot
force-pushed
the
indent/typing-nonblocking
branch
from
October 27, 2026 12:12
70b9025 to
db9aec9
Compare
tulir
approved these changes
Oct 27, 2026
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.
HandleMatrixTypingcalledRTM.SendMessage, which blocks once slackgo's 20-slot outgoing queue is full. That queue is only drained while the RTM websocket is connected, so it fills up whenever RTM is down: during reconnects, or for good whenConnectfails atclient.userBootandManageConnectionnever starts.Once that happens, the typing handler goroutine never returns. bridgev2 calls it with the portal's
currentlyTypingLockheld, so every later typing event in that room waits on the lock until the portal event loop gives up after 5 minutes (EventHandlingTimeoutTicks× 30s) and backgrounds it. Each typing event in that chat stalls the portal's event loop for 5 minutes.Changes:
RTM.TrySendMessage(websocket: add non-blocking RTM.TrySendMessage beeper/slackgo#8) and return an error when the queue is full, so bridgev2 logs a failed typing send instead of hanging.IsTypingis false. Slack's RTM has no stop-typing message, and we were sending a typing notification for stop events too.ErrNotLoggedInif RTM has been cleared bydisconnect(), instead of dereferencing nil.go.mod bumps slackgo from b34085b to 2c1b2ed, the merged beeper/slackgo#8 and its only new commit.
Checked:
go build ./...,go vet ./pkg/connector,staticcheck ./pkg/connector.Tag
@indentto continue the conversation here.