Repository navigation
fix(sessions): resolve session names case-insensitively - #2032
norrietaylor merged 3 commits into
Conversation
Session names are unique under ASCII case folding, but name lookup was exact. A name refused at activate time (e.g. case-r after Case-R) could not be resolved by destroy/exec/attach/policy in the casing it was refused in. Make DiskLoader::find_by_name fall back to the case-folded index lookup, and make the CLI's match_id_prefix compare names case-insensitively, matching how names are made unique. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughSession name lookup now supports unique ASCII case-insensitive matches. Exact-name matches take precedence, and ambiguous folded-name matches return no result. Command lookup retains ID-prefix matching when no folded name matches. ChangesSession name lookup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Session names can be found regardless of ASCII letter case without selecting a session when the match is ambiguous. The change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit checks each session name, Comment |
|
[inbox-patch:clobber] This PR would revert recently merged workSimulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):
Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected. If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block. |
…ed one Case-only duplicate names written before names were made unique under case folding can still coexist. The folded fallback now resolves only when exactly one name folds to the input, and the CLI tries an exact name before a folded one, so a lookup never picks a different session.
Only hex-shaped names reach match_id_prefix on a name miss, so the CLI tests now use them and pin that an ambiguous fold does not fall through to an id prefix. minimald's store test resolves a name in another casing.
|
/review |
|
@coderabbitai review |
|
Approved: no findings at Nothing to do. Clobber: none: |
|
There was a problem hiding this comment.
CodeRabbit and minimal-review approved this head; 0 unresolved threads.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVeYN3A
Session names are unique under ASCII case folding, but name lookup was exact. A name refused at activate time (e.g.
case-rafterCase-R) could not be resolved bydestroy/exec/attach/policyin the casing it was refused in.DiskLoader::find_by_namenow falls back to the case-folded index lookup after an exact miss.match_id_prefixnow compares names case-insensitively, matching how names are made unique.Verification
cargo fmt --all --check --manifest-path Cargo.tomlcargo clippy --workspace --all-targets --locked --manifest-path Cargo.toml -- -D warningscargo test --locked --manifest-path Cargo.toml -p sessions(575 passed)cargo test --locked --manifest-path Cargo.toml -p minimal --lib(355 passed; 1 pre-existing failurelegacy_network_spellings_parse_with_hintrequires nextest, which is not installed here)Summary by CodeRabbit