fix: normalize empty session name to null in min ls --json - #1154
Merged
norrietaylor merged 2 commits intoAug 1, 2026
Merged
Conversation
An empty-string name could reach storage via the rename path before that boundary was tightened to reject empty and whitespace-only names. Such legacy records left `null` and `""` as two on-disk spellings of "no name", so `min ls --json` exposed three representations of the `name` field (null, an empty string, and a non-empty string) and a JSON consumer had to handle both empty forms. Collapse the empty string to `None` when deserializing a Record, so the `name` field carries one canonical representation wherever it is read: null for "no name", a non-empty string otherwise.
📝 WalkthroughWalkthroughSession record deserialization now converts persisted empty names to ChangesSession name normalization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
norrietaylor
approved these changes
Jul 31, 2026
norrietaylor
marked this pull request as ready for review
July 31, 2026 22:40
…n-35b9e69d098a1628
norrietaylor
deleted the
inbox-patch/normalize-empty-session-name-json-35b9e69d098a1628
branch
August 1, 2026 00:20
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.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmg0-g
min ls --jsoncould report thenamefield three ways —null, an empty string, and a non-empty string — because a session name persisted as""(reachable via an older rename path that no longer accepts empty names) serialized verbatim instead of asnull, forcing a JSON consumer to treat bothnulland""as "no name". The fix collapses an empty-string name toNonewhen a sessionRecordis deserialized, so every read surface (themin lstable,--json, and record lookups) carries one canonical representation:nullfor "no name", a non-empty string otherwise. Normalizing at the deserialization boundary also cleans up any such value already on disk the next time it is read. No load-bearing Distillery precedent found.Verification
cargo fmt --all --check --manifest-path target/Cargo.toml — clean, no drift
cargo clippy --workspace --locked -- -D warnings — exit 0, 0 warnings
cargo build --workspace --locked — exit 0, Finished dev profile
cargo test --workspace --locked — exit 0, all pass; sessions lib 354 passed incl. record_with_empty_name_deserializes_as_none
Note
Normalize empty session name to
nullinmin ls --jsonoutputAdds a custom serde deserializer in lib.rs that maps empty string values to
Nonewhen deserializingRecord.name. This unifies the two on-disk representations of a missing session name (nulland"") toNoneat load time.Macroscope summarized 0beaed0.
Summary by CodeRabbit