The framework currently exhibits a race condition where component updates, if triggered immediately after creation, can be lost instead of being correctly queued. This has resulted in flaky Playwright tests that require manual synchronization (expect() calls) to work reliably.
A robust framework should handle these early updates gracefully by scheduling them to run after the initial render and mount process is complete. The fact that updates are being dropped indicates a flaw in the VDOM lifecycle management.
Plan:
- Isolate the Bug: Create a minimal, reproducible test case (e.g., a new example) that programmatically creates a component and immediately calls
set() on it in the next microtask.
- Add Diagnostic Logging: Temporarily add detailed logging to key methods in
src/mixin/VdomLifecycle.mjs (initVnode, updateVdom, resolveVdomUpdate) to trace the component's state (isVdomUpdating, vnodeInitialized, needsVdomUpdate) through the entire lifecycle.
- Analyze and Fix: Use the logs from the test case to identify the exact point where the update is being dropped and implement a fix to ensure it is correctly queued and processed.
The framework currently exhibits a race condition where component updates, if triggered immediately after creation, can be lost instead of being correctly queued. This has resulted in flaky Playwright tests that require manual synchronization (
expect()calls) to work reliably.A robust framework should handle these early updates gracefully by scheduling them to run after the initial render and mount process is complete. The fact that updates are being dropped indicates a flaw in the VDOM lifecycle management.
Plan:
set()on it in the next microtask.src/mixin/VdomLifecycle.mjs(initVnode,updateVdom,resolveVdomUpdate) to trace the component's state (isVdomUpdating,vnodeInitialized,needsVdomUpdate) through the entire lifecycle.