feat(sessions): push new sessions to the list instantly #328

Merged
dries merged 2 commits from fix/session-created-refresh into main 2026-07-13 23:00:40 +02:00
Owner

Summary

  • Broadcast a provisional session row on ocman.session.changed for created/moved sessions; the frontend inserts it into the ['sessions', ...] query cache before the authoritative refetch, so a new session appears without waiting for the next poll.
  • sessionsvc.Hooks.SessionCreated now receives a CreatedSession (id, platform, directory, title) built without extra I/O, keeping the create path fast.

Testing

  • make test (Go + vitest), make lint
  • Added Go coverage for the enriched hook/broadcast payload and frontend tests for insertProvisionalSession (dedup, dir-scope, empty-cache) and the forwarded session row.
## Summary - Broadcast a provisional session row on `ocman.session.changed` for created/moved sessions; the frontend inserts it into the `['sessions', ...]` query cache before the authoritative refetch, so a new session appears without waiting for the next poll. - `sessionsvc.Hooks.SessionCreated` now receives a `CreatedSession` (id, platform, directory, title) built without extra I/O, keeping the create path fast. ## Testing - `make test` (Go + vitest), `make lint` - Added Go coverage for the enriched hook/broadcast payload and frontend tests for `insertProvisionalSession` (dedup, dir-scope, empty-cache) and the forwarded session row.
feat(sessions): push new sessions to the list instantly
All checks were successful
CI / Build Desktop (macOS arm64) (pull_request) Successful in 1m50s
CI / Frontend (pull_request) Successful in 5m51s
CI / Backend (pull_request) Successful in 6m55s
CI / Coverage Ratchet (pull_request) Successful in 9m10s
CI / Build (pull_request) Successful in 3m45s
CI / Playwright E2E (pull_request) Successful in 5m46s
CI / Semantic Tag (pull_request) Successful in 4s
e118a601d5
Broadcast a provisional session row on ocman.session.changed for
created/moved sessions so the frontend inserts it into the list cache
before the authoritative refetch, instead of waiting for the next poll.

Coverage ratchet: pass

Suite Baseline This PR Δ
go 72.50% 72.50% +0.00
frontend 62.77% 62.96% +0.19

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | go | 72.50% | 72.50% | +0.00 | ✅ | | frontend | 62.77% | 62.96% | +0.19 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
dries merged commit 789216eb75 into main 2026-07-13 23:00:40 +02:00
Sign in to join this conversation.
No description provided.