Skip to content

fix(scheduler): improve error recovery - #14541

Merged
edison1105 merged 7 commits into
vuejs:minorfrom
yangmingshan:scheduler
Aug 28, 2026
Merged

fix(scheduler): improve error recovery#14541
edison1105 merged 7 commits into
vuejs:minorfrom
yangmingshan:scheduler

Conversation

@yangmingshan

@yangmingshan yangmingshan commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

This PR improves the error recovery on jobs flush, and with two other changes:

  1. recursive post jobs can't be re-queued by other jobs.
  2. reset currentFlushPromise only when no jobs are left to flush, to avoid unnecessary microtask.

There are two possible issues:

  1. jobs may left on queue when flushPreFlushCbs or flushPostFlushCbs errors.
  2. flushPreFlushCbs does not check the DISPOSED flag, not sure if it's intentional.

This PR is based on minor, let me know if I should change to main.

@coderabbitai

coderabbitai Bot commented Mar 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0979c144-d618-4288-a181-012536a2663c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Mar 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@14541
npm i https://pkg.pr.new/@vue/compiler-core@14541
yarn add https://pkg.pr.new/@vue/compiler-core@14541.tgz

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@14541
npm i https://pkg.pr.new/@vue/compiler-dom@14541
yarn add https://pkg.pr.new/@vue/compiler-dom@14541.tgz

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@14541
npm i https://pkg.pr.new/@vue/compiler-sfc@14541
yarn add https://pkg.pr.new/@vue/compiler-sfc@14541.tgz

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@14541
npm i https://pkg.pr.new/@vue/compiler-ssr@14541
yarn add https://pkg.pr.new/@vue/compiler-ssr@14541.tgz

@vue/compiler-vapor

pnpm add https://pkg.pr.new/@vue/compiler-vapor@14541
npm i https://pkg.pr.new/@vue/compiler-vapor@14541
yarn add https://pkg.pr.new/@vue/compiler-vapor@14541.tgz

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@14541
npm i https://pkg.pr.new/@vue/reactivity@14541
yarn add https://pkg.pr.new/@vue/reactivity@14541.tgz

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@14541
npm i https://pkg.pr.new/@vue/runtime-core@14541
yarn add https://pkg.pr.new/@vue/runtime-core@14541.tgz

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@14541
npm i https://pkg.pr.new/@vue/runtime-dom@14541
yarn add https://pkg.pr.new/@vue/runtime-dom@14541.tgz

@vue/runtime-vapor

pnpm add https://pkg.pr.new/@vue/runtime-vapor@14541
npm i https://pkg.pr.new/@vue/runtime-vapor@14541
yarn add https://pkg.pr.new/@vue/runtime-vapor@14541.tgz

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@14541
npm i https://pkg.pr.new/@vue/server-renderer@14541
yarn add https://pkg.pr.new/@vue/server-renderer@14541.tgz

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@14541
npm i https://pkg.pr.new/@vue/shared@14541
yarn add https://pkg.pr.new/@vue/shared@14541.tgz

vue

pnpm add https://pkg.pr.new/vue@14541
npm i https://pkg.pr.new/vue@14541
yarn add https://pkg.pr.new/vue@14541.tgz

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@14541
npm i https://pkg.pr.new/@vue/compat@14541
yarn add https://pkg.pr.new/@vue/compat@14541.tgz

commit: 5fa56f7

@github-actions

github-actions Bot commented Mar 7, 2026

Copy link
Copy Markdown

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 87.2 kB 30.6 kB 26.9 kB
runtime-dom.global.prod.js 117 kB (+122 B) 43.8 kB (+23 B) 39.3 kB (+121 B)
vue.global.prod.js 177 kB (+117 B) 64 kB (+46 B) 56.9 kB (-91 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 53.3 kB (+121 B) 20.7 kB (+12 B) 18.9 kB (+63 B)
createApp 62.3 kB (+121 B) 24 kB (+17 B) 21.8 kB (+25 B)
createApp + vaporInteropPlugin 118 kB (+124 B) 42.7 kB (+25 B) 38.4 kB (+59 B)
createVaporApp 30.7 kB (+119 B) 11.8 kB (+17 B) 10.8 kB (+21 B)
createSSRApp 67.5 kB (+122 B) 26.1 kB (+5 B) 23.6 kB (+21 B)
createVaporSSRApp 36.5 kB (+122 B) 13.9 kB (+15 B) 12.7 kB (+33 B)
defineCustomElement 69 kB (+122 B) 26 kB (+24 B) 23.7 kB (+30 B)
defineVaporCustomElement 46.5 kB (+119 B) 16.8 kB (+16 B) 15.4 kB (-18 B)
overall 77.7 kB (+125 B) 29.5 kB (+28 B) 26.7 kB (+40 B)

@yangmingshan yangmingshan changed the title fix(scheduler): align post-flush and flush fix(scheduler): improve error recovery Mar 8, 2026
@edison1105

edison1105 commented Mar 9, 2026

Copy link
Copy Markdown
Member

Thanks for the PR. LGTM.

jobs may left on queue when flushPreFlushCbs or flushPostFlushCbs errors.

fixed via 87742a8

flushPreFlushCbs does not check the DISPOSED flag, not sure if it's intentional.

flushPreFlushCbs() does not check for DISPOSED, mainly because there is no built-in path in the current runtime to mark pre-watcher jobs with this flag.

pre-jobs actually have only one source: watch(..., { flush: 'pre' }), which is enqueued via queueJob(job, ..., true). When a component is unmounted, scope.stop() is called on its scope first. Even if a watch job remains in the queue after the effect is stopped, its execution becomes a no-op because this.dirty is no longer truthy. It is bypassed not by checking DISPOSED, but because the effect itself has been invalidated.

@edison1105

Copy link
Copy Markdown
Member

/ecosystem-ci run

@vue-bot

vue-bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
radix-vue success success
primevue success success
test-utils failure success
pinia success success
vant success failure
vitepress success success
quasar success success
router success success
vueuse failure success
vite-plugin-vue success success
vue-simple-compiler success success
vue-macros failure success
nuxt failure success
vuetify failure success
vue-i18n failure success

@edison1105 edison1105 added the ready to merge The PR is ready to be merged. label Mar 9, 2026
@yangmingshan

Copy link
Copy Markdown
Contributor Author

@edison1105 Do we need to merge this PR before v3.6?

@edison1105
edison1105 merged commit 70bd789 into vuejs:minor Aug 28, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Ready To Merge to Done in Next Minor Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge The PR is ready to be merged. version: minor

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants