Discord: VOICE_STATE_UPDATE_OLD is unreachable dead code #43

Closed
opened 2026-08-29 09:59:43 -04:00 by Salastil · 1 comment
Owner

backend/discord.rs:2523 opens a match arm on the dispatch name "VOICE_STATE_UPDATE_OLD" — 63 lines that duplicate the VOICE_STATE_UPDATE arm immediately above it.

Discord has no such dispatch. _OLD is a field inside a VOICE_STATE_UPDATE payload in some shapes, not an event name, so the branch can never be entered.

Harmless at runtime, but it is 63 lines of voice-state handling that reads as live and will drift out of sync with the real arm the first time someone edits one and not the other.

Done looks like: the arm deleted. If the intent was to read the _OLD field for transition detection, that belongs inside the real arm.


Filed from a protocol coverage survey of the four deployed protocols, 2026-08-29 (moho 1a11250, nobilis 030707f).

`backend/discord.rs:2523` opens a match arm on the dispatch name `"VOICE_STATE_UPDATE_OLD"` — 63 lines that duplicate the `VOICE_STATE_UPDATE` arm immediately above it. Discord has no such dispatch. `_OLD` is a *field* inside a `VOICE_STATE_UPDATE` payload in some shapes, not an event name, so the branch can never be entered. Harmless at runtime, but it is 63 lines of voice-state handling that reads as live and will drift out of sync with the real arm the first time someone edits one and not the other. **Done looks like:** the arm deleted. If the intent was to read the `_OLD` field for transition detection, that belongs inside the real arm. --- _Filed from a protocol coverage survey of the four deployed protocols, 2026-08-29 (moho `1a11250`, nobilis `030707f`)._
Salastil added the bug label 2026-08-29 09:59:43 -04:00
Author
Owner

Finished — nobilis dc974b5

Finished — nobilis [`dc974b5`](https://git.salastil.com/Salastil/nobilis/commit/dc974b5)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#43