You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Apply all existing PR #2404 changes to NCExternalSignalingController.swift:
* Add hasChatRelay property
* Advertise chat-relay feature in hello messages
* Set hasChatRelay from server features
* Post extSignalingDidReceiveChatMessage notification
* Post extSignalingDidDisconnect notification on reconnect
- Apply all existing PR #2404 changes to NCChatController.m:
* Add chatRelayMessagesBuffer/Queue/externalSignalingController properties
* Add commonInitForRoom: to share init logic
* Register for chat relay notifications (scoped to specific controller instance)
* Switch from long-polling to chat relay mode on 304 response
* Add startProcessingChatRelayMessagesFromMessagesId:
* Add flushChatRelayMessagesBuffer
* Add handleChatRelayMessage: with gap sanity check
- Add new: fetch messages when websocket disconnects
* NCChatController observes extSignalingDidDisconnect
* On disconnect: stop relay, clear buffer, resume long-polling
* Polling catches up and auto-switches back to relay on 304
- Add new: sanity checks for flaky connections
* In handleChatRelayMessage: detect gap (messageId > lastKnownId + 1)
* On gap: fall back to long-polling which fills the gap
* Guard against false positives when lastNewestMessageId == 0
- Code quality:
* Thread-safe stopReceivingNewChatMessages via serial queue dispatch
* Renamed shouldStartLongPolling to hasReachedLatest for clarity
Co-authored-by: Ivansss <4638605+Ivansss@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nextcloud/talk-ios/sessions/b29edced-1384-4943-bc83-e345a364ccae
[NCLog log:[NSStringstringWithFormat:@"Chat relay gap detected: last=%ld, received=%ld – falling back to long-polling to fetch missing messages", (long)lastNewestMessageId, (long)message.messageId]];
0 commit comments