fix(desktop): keep cron, messaging and search inside the active profi… - #83640
cspiritsong wants to merge 1 commit into
Conversation
|
Thanks for the triage pass — the overlap is real, and consolidation is the right call. For orientation: #82515 scopes the messaging and cron caches, #82575 scopes sidebar data broadly, and this PR covers the full chain — messaging list, cron list, Pinned rows, search, and the remote-backend fan-out paths — with a test at each layer, including the non-GUI gateway paths where the same cross-profile leak appears. Happy to cooperate whichever way the maintainers prefer: rebase this into a delta on top of whichever PR is chosen as the base, trim it to only the parts the others don't cover, or close it if another PR supersedes it. |
fix(desktop): keep cron, messaging and search inside the active profile
|
|
Thanks for clarifying. Understood that #83640 is being kept open for the remaining session-search profile-scoping change. I’ll leave it open. |
4e1c947 to
8016cfa
Compare
|
Addressed the review points in rebased commit This PR is now intentionally the session-search profile-scoping delta only:
Verification on the rebased tree:
Please re-review the updated search-only head. |
Route concrete-profile search through the selected profile state.db, preserve All Profiles behavior, and discard stale full-text results after a profile switch.
95c0407 to
922d3fd
Compare
|
I’ve rebased this PR onto the live upstream The remaining gap is that Desktop search still calls This update:
Verification on the repaired current-main file set:
Please review this remaining search-only delta. |
|
Rebased onto current main and reopened as #114102. |
Summary
The sidebar keeps cron and messaging session caches warm by fetching them cross-profile, but in a concrete profile view those caches were rendered unfiltered: a profile like
sabbyshowed another profile's Telegram threads in the messaging platform sections, and Pinned resolution could surface cron/messaging rows from other profiles. Session search also hit every profile's DB regardless of scope, and the per-slice messaging fetches (seed + per-platform pager) always asked forprofile=all, bypassing the batched endpoint's single-scope behavior.This PR makes every sidebar surface answer to the same profile scope as Recents:
filterByProfile()— display-side filter applied to the cron and messaging caches before they feed Pinned resolution and the messaging platform sections. No-op reference passthrough in explicit All Profiles mode; untagged sessions normalize todefault, so single-profile users are unaffected./api/profiles/sessions/sidebarendpoint already does for every slice (the Bug: Desktop app shows Telegram sessions from ALL profiles in sidebar, ignoring active profile scope #65710/[Bug]: Desktop App shows all cronjobs for every profile (although crons are profile scoped) #42651/[Bug]: Concrete Desktop profiles mix Messaging sessions and can appear empty after switching #70629 single-scope contract).searchSessions()takes an optional profile and routes/api/sessions/search?profile=...; the sidebar clears FTS hits on scope change and ignores stale-scope responses while a scoped request is in flight.recents_profileas recents (previously hardcoded toall), keeping remote-profile setups consistent with the local endpoint.Notes
filterByProfilereturns the input array unchanged when nothing is filtered, so sidebar memos don't recompute on no-ops.Verification
npm run check:lint— clean (typecheck ×3, eslint 0 errors)npm run test:ui— 3683 passed (413 files)npm run test:desktop:platforms— skipped: needs packagedrelease/artifacts from a full build (exercises installer boot, not store logic)