Repository navigation
fix: keep recorded scope bindings in CachedSource cached data - #294
alexander-akait merged 1 commit into
Conversation
`getCachedData()` dropped the bindings a `scopes` request recorded, so a `CachedSource` restored from persistent cache had to stream its original again to report them, and one restored without an original could not. Carry them in the buffered map entries; the constructor already takes the entries as they are. Data from requests without the `scopes` option is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ThsbPWvW5vnYWEaFs2Q22F
|
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
c86ff86
into
claude/update-deps-github-actions-5ydose
|
Folded into #293, whose branch now includes this commit (c86ff86). Closing in favor of that single PR. Generated by Claude Code |
Summary
Stacked on #293, which is stacked on #275; the diff here is only this fix.
#293 has
CachedSourcerecord the bindings ascopesrequest streams, so it can replay them.getCachedData()still dropped them. ACachedSourcerestored from webpack's persistent cache therefore had to stream its original again to report its bindings, and one restored without an original could not report them at all.This change carries the recorded bindings in the buffered map entries of
getCachedData(). The constructor already takes those entries as they are, so a restored source replays the bindings straight from its data. The field is only added when bindings were recorded, so cached data from requests withoutscopesis unchanged. The bindings areMap<string, string>s in an array indexed by source, which webpack's serializer handles.What kind of change does this PR introduce?
fix
Did you add tests for your changes?
Yes, in
test/scopes.js:CachedSourcerestored fromgetCachedData(), whose original throws if it's used, produces the samescopesfield. This test fails without the fix.The full suite passes: 89,937 tests under
node --teston Node.js 22, and under Jest on Node.js 20 and 10.Does this PR introduce a breaking change?
No. Cached data gains an optional
scopeBindingsfield only after ascopesrequest.If relevant, what needs to be documented once your changes are merged or what have you already documented in this PR?
Nothing.
Use of AI
Claude Code found the gap while fixing #293 and wrote the change and tests.
🤖 Generated with Claude Code
https://claude.ai/code/session_01ThsbPWvW5vnYWEaFs2Q22F
Generated by Claude Code