fix(desktop): evict archived/deleted sessions from messaging slice immediately (#87716) - #87798
fix(desktop): evict archived/deleted sessions from messaging slice immediately (#87716)#87798webtecnica wants to merge 1 commit into
Conversation
…mediately (NousResearch#87716) archiveSession/removeSession only applied optimistic removal to $sessions (recents); the messaging slice ($messagingSessions) was only cleaned on the next refresh (2-4s delay). Apply the same optimistic filter to the messaging slice in lockstep, with rollback on RPC failure.
|
@webtecnica this and my #87774 are both for #87716, opened about six hours apart on 2026-08-16, and neither of us saw the other. Surfacing it so a maintainer picks one head rather than leaving two on Your rollback structure is sound and I want to say that first, because the obvious cheap criticism of it is wrong. Snapshotting Where the two heads actually differBoth of us fix the filter. Only one of us fixes the lookup in front of it, and I think the lookup is the more damaging half. const removed = $sessions.get().find(session => sessionMatchesStoredId(session, storedSessionId))
That is why #87774 adds The reason this is easy to miss, and it is in the testsEvery case in your setSessions([row])
setMessagingSessions([row, storedSession({ id: 'feishu-2', ... })])With the row in The same substitution makes the rollback assertion What I would like to doI am not going to argue mine should win on rebase state, so here is the state plainly: #87774 is rebased onto Two ways I am happy to go:
Either is fine by me - say which and I will do my half. cc @maintainers: two open PRs, same issue, same seam, six hours apart, and |
Problem
Archiving/deleting a messaging-platform session leaves the row visible for 2-4s. archiveSession/removeSession only applied optimistic removal to $sessions (recents); the messaging slice ($messagingSessions) was only cleaned on the next refresh via dropTombstoned().
Fix
Apply the same optimistic filter to the messaging slice in lockstep, with rollback on RPC failure. +88 lines of tests (4 cases: archive/drop, delete/drop, rollback).