fix(runtime-core): prevent currentInstance leak into sibling render during async setup re-entry#14668
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughClears a leaked component instance during Suspense async resolution by calling Changes
Sequence Diagram(s)sequenceDiagram
participant AsyncA as AsyncA (slow)
participant Suspense as SuspenseBoundary
participant Runtime as Runtime (currentInstance)
participant AsyncB as AsyncB (fast)
AsyncA->>Suspense: registerDep (starts async setup)
AsyncB->>Suspense: registerDep (starts async setup)
AsyncB->>Runtime: setCurrentInstance(AsyncB) / withAsyncContext
AsyncB-->>Suspense: resolves quickly
Suspense->>Runtime: retry render for AsyncB
Runtime-->>AsyncB: render (slots invoked)
AsyncA-->>Runtime: setCurrentInstance(AsyncA) / withAsyncContext (still resolving)
AsyncA-->>Suspense: resolves later
Suspense->>Runtime: before retry for AsyncA calls unsetCurrentInstance() rgba(255,0,0,0.5)
Runtime->>AsyncA: retry render for AsyncA (no lingering instance)
Suspense->>AsyncB: ensures no leaked instance into AsyncB slot render
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
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 |
bd4bb93 to
2f33bdd
Compare
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 #14667
Summary by CodeRabbit