Durable use cache: fix runtime env var mutation - #98558
Open
mischnic wants to merge 2 commits into
Open
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Tests PassedCommit: cc7aa3a |
gnoff
reviewed
Sep 11, 2026
Comment on lines
+242
to
+245
| expect(output).not.toContain( | ||
| 'Unexpected cache miss after cache warming phase during prerendering' | ||
| ) | ||
| expect(await browser.elementById('data').text()).toBe('test:unset') |
Contributor
There was a problem hiding this comment.
I don't love these expect.not.toContain because if we ever change the error text the test stops offering protection. I think we need to snapshot something here but do it in a way that doesn't churn too much. Or we need a debug that prints an affirmation that we didn't get this error or something
Member
Author
There was a problem hiding this comment.
Yeah, true. I could also assert Error:, that is hopefully stable...
mischnic
force-pushed
the
mischnic/env-var-mutation
branch
from
September 11, 2026 17:18
968dcf9 to
a9c75c4
Compare
mischnic
force-pushed
the
mischnic/env-var-existence-e2e
branch
from
September 11, 2026 17:18
e7699fe to
4068e2f
Compare
mischnic
force-pushed
the
mischnic/env-var-mutation
branch
from
September 11, 2026 21:28
a9c75c4 to
cc7aa3a
Compare
mischnic
marked this pull request as ready for review
September 11, 2026 21:52
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.

Problem
SOME_ENV_VARis unset.SOME_ENV_VAR.This lead to
Solution
Instead, snapshot the env vars once at module evaluation time of theuse cachefunction. This ensures that the cache key doesn't change over time. This is also how it worked thus far (with deployment id as the cache key): changing the env var over the lifetime of the process didn't lead to a reexecution of theuse cachefunctionRDC already stores cache entries generated in the previous phase (be it during
next buildmulti-phase rendering, or from prerender->resuming at runtime). Root params are already excluded from the cache keys when storing in RDC. Also exclude the env var hash bit, to conform to this system of preventing tearing (at the cost of potential staleness).