fix(runtime-core): force model update when reverted before sync (fix #13524)#14897
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughExpands useModel.set to detect a microtask-ordering edge where an intermediate emitted value is reverted before parent prop updates flush; adds a test reproducing the rapid onModelInput→onInput sequence and asserting post-nextTick stability. ChangesuseModel microtask timing
Sequence DiagramsequenceDiagram
participant Parent
participant Child
participant useModel
participant DOM
Parent->>Child: pass modelValue (initial)
Child->>useModel: mount with modelValue
useModel->>DOM: render initial
Note over Child,useModel: rapid listener sequence (microtask ordering)
Child->>useModel: onModelInput(intermediate)
useModel->>Parent: emit update: intermediate
useModel->>DOM: schedule local update (intermediate)
Child->>useModel: onInput(revert to initial)
useModel->>Parent: emit update: initial
useModel->>DOM: schedule local update (initial)
Note over useModel,Parent: parent prop may still be initial (no flushed update)
useModel->>useModel: detect changed vs prevSetValue && emittedValue == localValue
useModel->>DOM: force trigger() to ensure DOM sync
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
fix #13524 defineModel on Firefox does not work as expected
Summary by CodeRabbit
Bug Fixes
Tests