morethanwords/tweb/master • c86de98 • 4 files, +165/-30
Stop archiving the pinned chats of the main folder
267f53961 passed the requested folder into saveDialog on the premise that a
folder-scoped answer carries no dialog.folder_id. Checked against the server, the
opposite holds: folder_id is stamped on every dialog outside the main folder —
messages.getDialogs by folder, the global one and messages.getPeerDialogs alike —
while the answer for folder 1 ALSO returns the pinned dialogs of folder 0, and
those come unmarked. Stamping the requested folder on them moved every pinned chat
into the archive on a cold cache, where the chat list's Archive row is the first to
load a folder (bugs.telegram.org/c/64652). f7ceb786f had already fixed the same
thing by deleting dialog.folder_id ??= setFolderId.
So the folder is read back from the dialog alone, and a missing folder_id now wins
over the cached one instead of deferring to it — an affected client puts the chats
back into the main folder, pin included, on its next dialogs answer.
That leaves the pin limit it was meant to fix, whose real cause is elsewhere: a pin
lives in the order of the folder the dialog is in, and when the move is learned from
a dialogs answer rather than from updateFolderPeers (offline while it happened,
another device), nothing dropped the peer from the order of the folder it left. The
orders are persisted and only re-seeded by a cold fetch of folder 0, so the dead
entry ate a slot forever. saveDialog cleans the old folder now, and updateFolderPeers
unpins in the folder being left rather than in the destination.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
morethanwords/tweb/master • b2ccd23 • 300 files, +594/-594
Build
#webk
Post #20688
64
- 🫡 3