Skip to content

fix(hmr): multiple updates happened when invalidate is called while multiple tabs open#16307

Merged
patak-cat merged 1 commit into
vitejs:mainfrom
sapphi-red:fix/hmr-multiple-tabs-invalidate
Mar 29, 2024
Merged

fix(hmr): multiple updates happened when invalidate is called while multiple tabs open#16307
patak-cat merged 1 commit into
vitejs:mainfrom
sapphi-red:fix/hmr-multiple-tabs-invalidate

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

Description

While checking the flaky test I found this bug 🫠

Because import.meta.hot.invalidate is called from the browser side, if multiple tabs are open, multiple import.meta.hot.invalidate request is sent to server causing multiple updates.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@sapphi-red sapphi-red added feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority) labels Mar 29, 2024
@patak-cat

Copy link
Copy Markdown
Member

Oh, this is a very interesting one. Incredible there are still these kind of issues in Vite's HMR after all these years 🤯

@patak-cat

Copy link
Copy Markdown
Member

/ecosystem-ci run

@vite-ecosystem-ci

Copy link
Copy Markdown

@patak-cat patak-cat merged commit 21cc10b into vitejs:main Mar 29, 2024
@sapphi-red sapphi-red deleted the fix/hmr-multiple-tabs-invalidate branch March 30, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants