Skip to content

fix(desktop): scope the cron jobs list to the active profile - #67615

Merged
teknium1 merged 1 commit into
mainfrom
fix/cron-list-profile-scope
Jul 19, 2026
Merged

fix(desktop): scope the cron jobs list to the active profile#67615
teknium1 merged 1 commit into
mainfrom
fix/cron-list-profile-scope

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The desktop sidebar and cron overlay now show only the active profile's cron jobs — previously every profile's jobs leaked into the list because GET /api/cron/jobs defaults to profile=all and the desktop never sent the param (profileScoped(), landed in #67493, routes the backend process but adds no endpoint filter on local pools).

Salvage of #42654 by @digitalbase — the earliest report of this leak (June 9) — reworked onto current main per the sweeper review: threaded through the existing profileScoped() / list-param seams instead of the original PR's pre-refactor call sites (DesktopController has since delegated its cron refresh to use-session-list-actions). Authorship preserved.

Changes

  • apps/desktop/src/hermes.ts: getCronJobs(profile?) appends ?profile= when given; omitting the arg keeps the legacy unfiltered path.
  • apps/desktop/src/app/session/hooks/use-session-list-actions.ts: the sidebar's cron refresh passes the sidebar's profile scope (concrete profile → its own jobs; ALL_PROFILES → 'all' unified view).
  • apps/desktop/src/app/cron/index.tsx: the cron overlay's refresh uses the same scope, so overlay and sidebar (shared $cronJobs atom) always agree.
  • Tests: ?profile= list contract in hermes-cron-scope.test.ts; sidebar scoping (concrete + all) in use-session-list-actions.test.tsx.
  • contributors/emails/gijs@digitalbase.eu: contributor mapping.

Partially addresses the cron half of #52401 (cross-profile UI leak).

Validation

Check Result
npx vitest run — cron scope contract, session-list actions, cron model tests 20/20 pass (3 new)
tsc / eslint / prettier clean

Infographic

cron-list-profile-scope

Salvaged from #42654 by @digitalbase (earliest report of the leak, June 9):
the desktop sidebar and cron overlay showed EVERY profile's jobs because
GET /api/cron/jobs defaults to profile=all and the desktop never sent the
param — profileScoped() (landed in #67493) routes the backend process but
adds no endpoint filter on local pools.

- hermes.ts: getCronJobs(profile?) appends ?profile= when given; omitting
  the arg keeps the legacy unfiltered path. profileScoped() still rides
  along for process routing.
- use-session-list-actions.ts: sidebar cron refresh passes the sidebar's
  profile scope (concrete profile → own jobs; ALL_PROFILES → 'all').
- app/cron/index.tsx: the cron overlay's refresh uses the same scope so
  the overlay and sidebar (shared $cronJobs atom) always agree.
- Tests: list ?profile= contract in hermes-cron-scope.test.ts; sidebar
  scoping in use-session-list-actions.test.tsx.

Reworked onto current main per the sweeper review: threaded through the
existing profileScoped()/list-param seams instead of the original PR's
pre-refactor call sites (DesktopController has since delegated to
use-session-list-actions).
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/cron Cron scheduler and job management area/profiles Multi-profile isolation, HERMES_HOME scoping needs-decision Awaiting maintainer decision before any implementation labels Jul 19, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: this is a salvage/expanded active-profile cron-list repair alongside #42654 and #52910; its sidebar-and-overlay scope is not duplicate lineage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/cron Cron scheduler and job management comp/desktop Electron desktop app (apps/desktop/*) needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants