Skip to content

connector/chatsync: fix XChat chat info sync self-deadlock in portal event handler#107

Open
Fizzadar wants to merge 1 commit into
mainfrom
nick/bios-35204-xchat-chatinfo-self-deadlock
Open

connector/chatsync: fix XChat chat info sync self-deadlock in portal event handler#107
Fizzadar wants to merge 1 commit into
mainfrom
nick/bios-35204-xchat-chatinfo-self-deadlock

Conversation

@Fizzadar

@Fizzadar Fizzadar commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

With a synchronous portal event queue (PortalEventBuffer = 0, as set by the Beeper client SDK), syncXChatChannel can be reached from inside a portal's own event handler (message conversion → RefreshConversationKeysHandleConversationDataRefresh). Queueing a ChatInfoChange for the same portal from there blocks forever on portal.eventsLock, which the handler's own dispatcher holds. Bridge.Start then never returns, hanging bridge stop/start and leaving client sends stuck.

Fix

When bridgev2.GetRemoteEventFromContext(ctx) shows we are already inside this portal's event handler, apply the chat info via portal.UpdateInfo directly (same as bridgev2's handleRemoteChatResync) instead of re-entering the event queue.

Linear: https://linear.app/beeper/issue/BIOS-35204/sanakh-ios-room-send-queue-waited-on-sdk-restart-leaving-whatsapp

…tal event handler

With a synchronous portal event queue (PortalEventBuffer=0), queueing a
ChatInfoChange for the same portal from inside its own event handler (via
RefreshConversationKeys during message conversion) deadlocks on
portal.eventsLock. Apply the chat info update directly in that case.
@Fizzadar Fizzadar changed the title BIOS-35204: Fix XChat chat info sync self-deadlock in portal event handler BIOS-35204 Fix XChat chat info sync self-deadlock in portal event handler Jul 8, 2026
@Fizzadar Fizzadar changed the title BIOS-35204 Fix XChat chat info sync self-deadlock in portal event handler connector/chatsync: fix XChat chat info sync self-deadlock in portal event handler Jul 8, 2026
@Fizzadar Fizzadar marked this pull request as ready for review July 8, 2026 13:22
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