In some cases the client will stop requesting member chunks, leading to users roles and nicknames not loading

(#4615) Bug Open: Needs info Priority: P1 api desktop messaging self-hosting

Thread

Comment by syah
syah 1 vote Reproduced on Windows
Reproduced Platform: Windows Build information: Canary Desktop 2026.1101.102914, Web 2026.1103.134007, Windows 11 10.0.26300 (x64), Electron 44.10.0, Chrome 152.0.7977.169, Node 24.22.1, Locale en-GB Reproduction steps Start Fluxer Canary in a fresh session. Open a second instance, or sign out and back in to create a new gateway session. Select a guild other than the one selected when you first logged in. The initial guild seems to get marked as synced automatically, so use a different one. Enable Developer Mode under User Settings > Advanced, then turn on gateway debug logging. Watch the logs when the connection reports ready. Look for: "Attempted to send gateway payload while socket is not open" Check if a LAZY_REQUEST with sync: true was actually sent for that guild, and whether a GUILD_SYNC comes back afterwards. Open a channel in that guild and scroll through messages from members who haven't been loaded yet. I've been seeing this happen around 1 out of 3 attempts when switching instances. It seems to happen more often when the socket is still opening by the time the session reports ready. Expected behaviour The client should send the guild sync request, receive GUILD_SYNC, and then request the necessary member chunks. Member names, nicknames, and roles should load normally in chat. Actual behaviour Sometimes the sync request never actually gets sent. The logs show: Attempted to send gateway payload while socket is not open There is also no matching Gateway payload sent entry for the guild, and no GUILD_SYNC ever comes back. As a result, message authors show up without their roles or nicknames. The logs also keep repeating: Failed to hydrate members, will retry on the next load or reconnect error: Error: Request timed out The problem doesn't seem to recover on its own. Leaving and reopening the channel or scrolling through messages doesn't help. It stays broken until I switch accounts or restart the app. I spent some time tracing where the guild sync request is handled, and I think I found what's causing this. Inside GatewayGuildSubscriptionSynchronizer.sync(), the client calls socket.updateGuildSubscriptions() and immediately marks that guild as synced for the current session: socket.updateGuildSubscriptions({subscriptions: {[guildId]: {active: true, sync: true}}}); this.syncedSessionByGuild.set(guildId, sessionId); The issue is that updateGuildSubscriptions() doesn't return whether the request actually went through. It returns void and can silently fail: updateGuildSubscriptions(params): void { if (!this.isConnected()) return; if (!this.sendPayload({op: GatewayOpcodes.LAZY_REQUEST, d: params})) return; this.subscriptionLedger.record(params.subscriptions); } sendPayload() returns false if the socket isn't OPEN, but that result never makes it back to sync(). There's also a mismatch between the connection checks. sync() checks isReady, but the actual send checks isConnected(), which also requires the socket's readyState to be OPEN. So the session can report that it's ready even though the socket isn't ready to send anything. The bigger problem is what happens afterwards. Even though the request failed, the guild gets added to syncedSessionByGuild. When sync() runs again, the deduplication check sees that guild as already synced and skips it. I also noticed that resetConnectionTracking() only clears this tracking when a session is retired or replaced. A normal reconnect or resume doesn't appear to clear it. This also explains why member chunks never get requested. GuildMembers.requestPendingMembers() checks hasCompletedGuildSync(guildId), which depends on receiving GUILD_SYNC. Since that never arrives, the member request gets blocked every time. So the way I understand it, one failed gateway send can leave a guild permanently marked as synced even though the sync never happened. Everything that depends on that sync then gets stuck until the session is replaced.