fix: avoid caching transform result of invalidated module #7254
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.
Description
See #7243 for more context and a bug reproduction. Splitting this from there as they aren't related. And we can keep discussing here about this issue.
When we call
moduleGraph.invalidateAll()
before doing the full-reload after re-processing, there are requests that are on the fly and end up updating their module info... so when the browser requests them after the full reload... these modules are stale. @vursen this is what we were seeing in Vaadin with the 504 errors in the browser that didn't disappear even when reloading the page manually.We need that a full-reload call will also stop every currently processing request to avoid modifying the module graph.
I think this could have been also present before, but now it is more visible because we aren't blocking the requests as before while processing. So a solution here may fix hard-to-replicate issues that we got in the past.
What is the purpose of this pull request?