Discord: the pin list goes stale while you are looking at it #120

Closed
opened 2026-09-06 12:04:30 -04:00 by Salastil · 1 comment
Owner

#106 added pinned messages. Discord announces a change to them with
CHANNEL_PINS_UPDATE, which moho does not handle - the dispatch is absent from the
match in backend/discord.rs:4213+.

So the list is right when it is opened and wrong afterwards: somebody pinning a
message while you have the panel open does not appear, and unpinning leaves a message
listed that is no longer pinned. Reopening the panel fixes it, which is the tell.

What is needed

  • Handle CHANNEL_PINS_UPDATE and re-ask /channels/{id}/pins for that channel, or
    simply mark the cached list stale so the next open refetches.
  • moho's own pin and unpin already refresh the list; this is the other side of it.

Done looks like: a pin made anywhere shows up here without reopening anything.

Reference: the official Discord client.

#106 added pinned messages. Discord announces a change to them with `CHANNEL_PINS_UPDATE`, which moho does not handle - the dispatch is absent from the match in `backend/discord.rs:4213+`. So the list is right when it is opened and wrong afterwards: somebody pinning a message while you have the panel open does not appear, and unpinning leaves a message listed that is no longer pinned. Reopening the panel fixes it, which is the tell. **What is needed** - Handle `CHANNEL_PINS_UPDATE` and re-ask `/channels/{id}/pins` for that channel, or simply mark the cached list stale so the next open refetches. - moho's own pin and unpin already refresh the list; this is the other side of it. **Done looks like:** a pin made anywhere shows up here without reopening anything. Reference: the official Discord client.
Salastil added the bugprotocollow priority labels 2026-09-06 12:04:30 -04:00
Salastil removed the protocol label 2026-09-06 12:49:14 -04:00
Author
Owner

Finished.

Handled in nobilis 2aee7a2.

CHANNEL_PINS_UPDATE says only that the list changed, never what it changed to, so the answer is to ask for it again - list_pinned for that buffer, in its own task so the gateway loop keeps reading while an HTTP round trip happens.

It refetches only for a conversation this client is actually showing (discord_buffer_for_channel returns nothing otherwise). A pin in a guild's four hundredth channel is not worth a request.

Finished. Handled in nobilis [2aee7a2](https://git.salastil.com/Salastil/nobilis/commit/2aee7a23bf59b2b27a624312b45f1c27ce5e0c1a). `CHANNEL_PINS_UPDATE` says only that the list changed, never what it changed to, so the answer is to ask for it again - `list_pinned` for that buffer, in its own task so the gateway loop keeps reading while an HTTP round trip happens. It refetches only for a conversation this client is actually showing (`discord_buffer_for_channel` returns nothing otherwise). A pin in a guild's four hundredth channel is not worth a request.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#120