You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Session GC deletes parseable records with malformed compression or companion data #6141
At e1e33a9, opt into session GC and create an old record whose state.blocks is an object containing a summary instead of an array. viewFromParsed treats it as empty and deletes it. An old session with a companion byHash entry containing an object is counted as zero companion tokens and both files are deleted.
Expected behavior
Retain data whose compression/content representation is unrecognized, as required by the existing corrupt-file policy. Supported legacy records with absent optional fields should retain their existing defaults.
Verified patch
Validate explicit state, block-content and stats shapes plus finite non-negative token counts; reject non-string companion content entries. Three regressions fail on unchanged source, including a real-files run that deletes two sessions. The patch retains both sessions and their companion, and passes all 26 session-GC tests, typecheck and build. #1084 introduced GC and #1189 added companion retention; these malformed-valid-JSON cases are separate.
Activity
ranxianglei commentedon Nov 12, 2026
Fixed in batch PR #6439 (merged).