fix(gateway): isolate dot-segment session storage paths - #119
Closed
NianJiuZst wants to merge 1 commit into
Closed
NianJiuZst wants to merge 1 commit into
NianJiuZst wants to merge 1 commit into
Conversation
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.
Purging a session named
.or..could recursively delete every session or the entire storage root, including when that session did not exist. Encode these IDs as ordinary directory names and reject empty storage keys before resolving any session path. Existing encodings for normal IDs remain compatible.关联 Issue
Closes #117
变更类型
影响范围
src/gateway/(session authority 行为变更)变更说明
The fix lives in the shared storage layout helpers, protecting purge as well as snapshot, event, asset and trace paths. Dot-only IDs still round-trip and remain distinct from literal percent-encoded IDs.
Regression tests exercise the real authenticated HTTP DELETE endpoint with temporary storage. They verify that unknown dot-only IDs preserve unrelated data and that purging an existing encoded session deletes only its own directory. No model calls or user storage are involved.
测试计划
pnpm exec vitest run src/gateway/storage/layout.test.ts tests/integration/session-purge.test.ts— 43 passed.pnpm check— passed; 1,542 tests passed, 7 skipped.pnpm test:coverage— passed; statements 83.73%, branches 85.04%.自检清单
Validation was performed on macOS arm64 with Node.js 26.8.1. The repository's Windows/Linux CI remains the cross-platform validation gate.