Repository navigation
[CTX-1342] fix(session): refuse pin-only empty tiled base with a typed error (#2230) - #2235
Merged
Merged
Conversation
After CTX-1337 (#2222), a pin-only empty tiled base is a valid live state. Validation no longer reports it as file corruption: capture refuses it with the typed SessionError::PinOnlyEmptyBase diagnostic. Persisting it needs a v3 codec change in bitty-storage (it rejects every empty workspace), so the in-repo change is the explicit refusal allowed by #2230. Pinless empty workspaces remain Corrupt, preserving the never-empty invariant. Add a deterministic runtime-to-file test for the refusal (no file write, existing session untouched) and a normal-workspace-with-pins round-trip regression test.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 44 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Priority: P2 | Area: area:runtime | Labels: fix,P2,area:runtime | Milestone: v0.1.0 | RFC: session storage | Task: CTX-1342
Closes #2230
What
After #2222, a pin-only empty tiled base is a valid live state. Session capture reported
session file corrupt (empty workspace)and saved nothing. It now refuses with a typedPinOnlyEmptyBaseerror and leaves the existing session file untouched.Why refusal, not persistence
The v3 codec and a duplicate
validate_snapshotlive in the externalbitty-storagecrate (pinned5e720b4);encode_sessionrejects every empty-layout workspace. Persisting needs a codec change plus a dependency bump, tracked as bitty-storage#15.Changes
bitty-runtime/src/runtime/session.rs:SessionError::PinOnlyEmptyBase, narrow condition (empty layout + focus names a live pin); pinless/unfocused empty workspaces stillCorrupt("empty workspace").bitty-terminal/src/session_storage_tests.rs: real fix(ui): pinned panel leaves a session-less focused leaf after the last tiled panel closes #2222 state → capture → save: typed refusal, no file written, prior session byte-identical; normal pinned workspace round-trips unchanged.Verification
-D warnings(runtime+terminal all targets), Windows workspace all-targets: passCorrupt("empty workspace")Non-goals
Persisting pin-only state; never-empty invariant unchanged.