fix(desktop): gate messaging session polling - #58332
Open
izumi0uu wants to merge 1 commit into
Open
Conversation
Avoid arming the desktop's broad messaging session poll when there is no messaging view, active messaging thread, cached messaging row, or configured gateway platform reported by the existing status snapshot. Constraint: Preserve live messaging updates for users who open messaging, already have messaging sessions, or run configured gateway platforms. Rejected: Removing the messaging poll entirely | would regress inbound platform conversations that are written outside the desktop websocket. Confidence: high Scope-risk: narrow Directive: Keep future desktop background polls gated by existing local state or already-running status probes before adding new recurring backend calls. Tested: npm --workspace apps/desktop run test:ui -- src/app/desktop-controller-utils.test.ts; npm --workspace apps/desktop exec eslint -- src/app/desktop-controller-utils.ts src/app/desktop-controller-utils.test.ts src/app/desktop-controller.tsx; git diff --check Not-tested: npm --workspace apps/desktop run typecheck currently fails before this patch on missing workspace dependencies (@codemirror/*, @xterm/addon-serialize, fflate).
This was referenced Jul 26, 2026
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Gates the desktop's broad messaging-session polling so it only runs when there is evidence that messaging needs live updates: the Messaging view is open, the active stored session is a messaging thread, messaging rows are already loaded, or the existing
/api/statussnapshot reports a configured gateway platform.This keeps inbound Telegram/WeChat/Discord sessions live for configured messaging users while avoiding the always-on 10s cross-profile session scan for desktop users who are not using messaging.
Related Issue
Fixes #58309
Type of Change
Changes Made
shouldPollMessagingSessionsinapps/desktop/src/app/desktop-controller-utils.ts.apps/desktop/src/app/desktop-controller.tsxbefore arming the 10s messaging-session interval.How to Test
npm --workspace apps/desktop run test:ui -- src/app/desktop-controller-utils.test.tsnpm --workspace apps/desktop exec eslint -- src/app/desktop-controller-utils.ts src/app/desktop-controller-utils.test.ts src/app/desktop-controller.tsxgit diff --checkNote:
npm --workspace apps/desktop run typecheckcurrently fails before this patch in this lane because workspace dependencies such as@codemirror/*,@xterm/addon-serialize, andfflateare not resolvable.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Targeted validation: