[diffs] Cache Key Cleanup - #1055
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5643fb2398
ℹ️ 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".
otherwise you can get into bad scenarios where you combine 1 file with other files that don't have cache keys and you're fucked cause the cache keys will match but be incorrect
5643fb2 to
e457b19
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7d029a7a8
ℹ️ 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".
| return oldCacheKey != null && newCacheKey != null | ||
| ? composeCacheKey('diff', oldCacheKey, newCacheKey) | ||
| : undefined; |
There was a problem hiding this comment.
Preserve cache keys for single-sided diffs
When MultiFileDiff renders an added or deleted file with edit and editorOptions.persistState, one side is necessarily null, so this condition discards the non-null file's caller-supplied cacheKey. The editor later passes the parsed metadata to requirePersistedCacheKey and throws instead of attaching, breaking persisted editing for all one-sided diffs; derive a side-tagged key from the sole real file rather than returning undefined.
Useful? React with 👍 / 👎.
(WIP) Essentially
cacheKeyswere incorrectly inherited from file names with the edit release, which breaks a lot of assumptions how how they should work.This PR is looking over that infrastructure to try and clean all that up and harden the system.