Skip to content

Retain Create/Activate selection until catalogue catches up - #40

Merged
ElSargo merged 1 commit into
mainfrom
fix/create-completion-retain-until-catalogue
Sep 16, 2026
Merged

ElSargo merged 1 commit into
mainfrom
fix/create-completion-retain-until-catalogue

Conversation

@ElSargo

@ElSargo ElSargo commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • On successful Create/Activate/Rename, set selected to the completed identity even when the session row is not yet in sessions (same contract as worktree).
  • Teach ensure_selection to retain an unpublished (backend_id, session_id) realm instead of rebinding to an older catalogue row.
  • Remit Command completion and catalogue publication are independent in docs/frictions/ui-concurrency.md.
  • Add regression tests for pre-catalogue Create selection and stale-catalogue realm/selection divergence.

Fixes #33

Residual risk

Native client select_active_session on Activate/Create success can still focus before catalogue install. A shared commit receipt across completion and catalogue publication remains future work (related to #30).

Test plan

  • cd plugins/session-switcher && RUSTFLAGS='-C linker=cc' cargo test --lib — 46 passed
  • Manual: create a session and confirm list selection stays on the new id if the catalogue is briefly stale

@ElSargo ElSargo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brood QA (static) — code looks good

Verdict: COMMENT LGTM for remit of #33 (Create/Activate selection vs catalogue lag). Not a formal APPROVE (reviewer is ElSargo).

Evidence

  • Successful Create/Activate/Rename sets selected = Some((backend_id, session)) even when the row is absent from sessions (aligns with worktree retain contract).
  • ensure_selection retains unpublished (backend_id, session_id) realm instead of snapping to an older catalogue row.
  • Tests: create completion before catalogue; stale catalogue after create keeps realm/selection on new id.

Residuals (acknowledged)

  • Native client select_active_session can still focus before catalogue install; shared commit receipt across completion + catalogue remains future work (related to #30 / #36).

CI

FAILED — GHA Nix ENOSPC. Not a code blocker.

Stacking

Touches session-switcher + ui-concurrency.md with #36 / #37. Land after #36 (and ideally after #37) or expect conflict resolution on both files.

Desktop verify: not run (manual “create then stale catalogue” needs interactive client).

Align ordinary Create/Activate/Rename selection with the worktree
retain-until-catalogue contract, and keep ensure_selection from snapping
list selection away from an unpublished realm identity when a delayed
catalogue still lacks that row.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session-switcher: activate/create completion races catalogue publication

1 participant