fix(desktop): preserve expanded messaging pages across polling - #65527
fix(desktop): preserve expanded messaging pages across polling#65527PINKIIILQWQ wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating a real renderer-cache regression. Current main fetches the aggregate messaging seed at apps/desktop/src/app/session/hooks/use-session-list-actions.ts:100, directly replaces the cache at :108, and independently expands a platform at :120-133; the PR's per-source reconciliation addresses that mismatch.
Problems
apps/desktop/src/app/session/hooks/use-session-list-actions.ts:109(PR right side) still publishes any completed refresh. The 10-second poll atapps/desktop/src/app/contrib/hooks/use-background-sync.ts:102-110can overlap another refresh, but unlikerefreshSessions(use-session-list-actions.ts:76,154-184) this path has no request-generation guard. An older sub-cap response would enter the new helper's authoritative!truncatedbranch (apps/desktop/src/store/session.ts:224-226, PR right side) and overwrite newer cached rows.
Suggested changes
- Fence messaging refresh publications with a request ref/counter, including
setMessagingTruncated, and add a reversed-resolution test for overlapping requests.
Automated hermes-sweeper review.
| @@ -105,11 +106,16 @@ export function useSessionListActions({ profileScope }: UseSessionListActionsArg | |||
| // Drop any non-messaging source the broad exclude didn't catch (custom | |||
| // sources) — those stay in local recents, not a platform section. | |||
| const rows = result.sessions.filter(s => isMessagingSource(s.source)) | |||
| const truncated = result.sessions.length >= MESSAGING_SECTION_LIMIT | |||
There was a problem hiding this comment.
Please fence this publication with a messaging-refresh request counter, as refreshSessions does. The visible 10-second poll can overlap a newer refresh or platform-page update; an older sub-cap response would make reconcileMessagingRefresh(..., false) return its stale incoming page and overwrite the newer cache.
d6d3570 to
aef4177
Compare
|
Addressed all review feedback and rebased onto latest main (238 new commits including a test-infrastructure refactor):
|
aef4177 to
839eb4c
Compare
f37d07d to
91d2db3
Compare
What does this PR do?
Prevents Desktop messaging sections from shrinking after the user loads more conversations and the 10-second background poll runs.
Regression
The live messaging poll added by #57636 correctly keeps Telegram / WeChat / Feishu traffic fresh, but its combined seed is capped at 100 rows across all platforms. A per-platform load-more request can load 13 Feishu conversations while the next combined seed contains only 4 Feishu rows. The refresh previously replaced the entire messaging cache, so the section appeared to collapse from 13 back to 4.
This was discovered while manually validating #51407 and is intentionally kept separate from that scrollbar-only PR.
Changes
Reproduction covered by the test
The hook-level test failed on unmodified main with: expected 13, received 4.
Validation
Scope
Desktop renderer state reconciliation only. No gateway, database, API, CSS, or polling-interval changes.