Skip to content

fix: race condition creation module in graph in transformRequest#13085

Merged
patak-cat merged 1 commit intomainfrom
fix/race-conditions-creating-module-in-graph-in-transform-request
Jun 8, 2023
Merged

fix: race condition creation module in graph in transformRequest#13085
patak-cat merged 1 commit intomainfrom
fix/race-conditions-creating-module-in-graph-in-transform-request

Conversation

@patak-cat
Copy link
Member

Description

Potential fix for #13030

Related to #8533

There could be a race condition if on the middle of processing a request, something changes in the environment (user code, optimized dep invalidation) that causes resolveId to return two different ids for the same URL.

We already had the module or the resolve result, and in loadAndTransform we were doing a new resolveId from the url after call load. This PR, avoids re-resolving by passing the resolved result if we already did it before load so we ensure the module node we add to the graph is the one we are currently transforming.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-cat
Copy link
Member Author

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented May 3, 2023

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt ❌ failure
previewjs ✅ success
qwik ✅ success
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-pages ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success
windicss ✅ success

@patak-cat patak-cat merged commit 43cbbcf into main Jun 8, 2023
@patak-cat patak-cat deleted the fix/race-conditions-creating-module-in-graph-in-transform-request branch June 8, 2023 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants