Namespace the extracted game-asset cache by installation root - #116
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 542cd3ec63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a42a470b2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
b4a54a6 to
7874ead
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4a54a64bb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7874ead4bc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23015750f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 885b7bb27a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c34241d90b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The cache under ~/.wurst/casc_cache/{casc|mpq}/... was keyed only by
storage kind, so pointing wurst.wc3path at a different install of the
same kind (two Reforged builds, a PTR beside retail) kept serving
assets extracted from whichever one was cached first. #109 made a root
switch take effect at runtime, which made it easy to hit.
Each cache path is now keyed by kind + a short hash of the install
root, and the lookups hand back the exact path they read or wrote
rather than re-deriving it afterwards from a root that may have
changed in between. The tag hashes the root's realpath, so the same
install reached via a symlink, a different drive-letter case or a
hand-typed setting shares one bucket instead of duplicating the whole
extracted tree; the path given to the storage openers is unchanged.
Three routes that bypassed the namespace are closed: the pre-kind-split
casc_cache/<asset> layout is no longer read, getCandidateRoots() no
longer offers the cache as a generic local asset root, and no path
inside the cache can become one — previewing a file that itself lives
in the cache used to walk ancestors back into another install's bucket.
Cache entries can only be read back when an install is detected, since
otherwise there is no way to know which bucket belongs to the active
one. Existing caches are orphaned and re-extracted once, the trade-off
the issue called for.
Closes #110.
c34241d to
ddfc51b
Compare
Closes #110.
The cache under
~/.wurst/casc_cache/{casc|mpq}/...was keyed only by storage kind, so pointingwurst.wc3pathat a different install of the same kind (two Reforged builds, a PTR beside retail) kept serving assets extracted from whichever one was cached first.Each cache path is now keyed by kind + a short hash of the install root, and lookups return the exact path they read or wrote instead of re-deriving it from a root that may have changed in between. The tag hashes the root's
realpath, so one install reached via a symlink, a different drive-letter case, or a hand-typed setting shares a single bucket rather than duplicating the whole extracted tree — the path handed to the native storage openers is unchanged.Three routes that bypassed the namespace are closed: the pre-kind-split
casc_cache/<asset>layout is no longer read,getCandidateRoots()no longer offers the cache as a generic local asset root, and no path inside the cache can become one (previewing a file that itself lives in the cache used to walk ancestors back into another install's bucket).Top-level cache dir path is unchanged, so the webview
localResourceRootsentry still works.Deliberate trade-offs
Not covered
Parsed SLK/profile/catalog data cached in memory (
wc3Data.ts,objModPreview.ts) isn't cleared whenwurst.wc3pathchanges, so it can still answer with the previous install's data until a window reload. Pre-existing and a separate subsystem — filed as #117.Checks
tsc --noEmit,npm run lint,npm test, andnpm run test:e2e(44 passed) all green.