Skip to content

websocket: add non-blocking RTM.TrySendMessage - #8

Merged
Fizzadar merged 2 commits into
beeperfrom
indent/rtm-try-send-message
Oct 27, 2026
Merged

Fizzadar merged 2 commits into
beeperfrom
indent/rtm-try-send-message

Conversation

@Fizzadar

Copy link
Copy Markdown

RTM.SendMessage pushes onto the 20-slot outgoingMessages channel, which is only drained by handleEvents while the websocket is connected. If the connection is down, reconnecting, or ManageConnection was never started, the 21st call blocks forever.

TrySendMessage does the same send in a select with default, returning false instead of blocking when the queue is full. mautrix-slack uses it for typing notifications, which are fine to drop.

Checked with a throwaway program against an unstarted RTM: TrySendMessage returns false on the 21st message, and a following SendMessage is still blocked after 2s.

View in Indent
Tag @indent to continue the conversation here.

@Fizzadar Fizzadar left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@indent go fix

Comment thread websocket.go Resolved
@indent

indent Bot commented Oct 27, 2026

Copy link
Copy Markdown

Removed the doc comment from TrySendMessage in 71d8679. I also re-pinned mautrix/slack#128 to that commit.

View session

@Fizzadar
Fizzadar marked this pull request as ready for review October 27, 2026 11:47
@indent

indent Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Issues

No issues found.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No issues found in TrySendMessage.
Full results

Indent Review Agent

  • Summary: No issues found in TrySendMessage.
  • Last ran on commit: 71d86795
  • Latest result
    {
      "summary": "No issues found in TrySendMessage.",
      "findings": []
    }

@Fizzadar
Fizzadar merged commit 2c1b2ed into beeper Oct 27, 2026
1 of 5 checks passed
@Fizzadar
Fizzadar deleted the indent/rtm-try-send-message branch October 27, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant