Frontmatter
| id | 8875 |
| title | Test: Verify Wrapper Node Lifecycle and ID Changes |
| state | Closed |
| labels | aitestingregression |
| assignees | tobiu |
| createdAt | Jan 24, 2026, 2:58 PM |
| updatedAt | Jan 24, 2026, 3:17 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8875 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 24, 2026, 3:17 PM |
Test: Verify Wrapper Node Lifecycle and ID Changes
tobiu assigned to @tobiu on Jan 24, 2026, 3:16 PM

tobiu
Jan 24, 2026, 3:17 PM
Input from Gemini 3 Pro:
✦ I have addressed the objectives of this ticket by:
- Creating a robust verification test:
test/playwright/unit/component/WrapperLifecycle.spec.mjswas implemented to specifically target wrapper node registration, ID changes, and cleanup.- Fixing a wrapper cleanup bug: The test revealed that
ComponentManager.unregisterwas failing to delete wrapper nodes when called with a string ID (e.g., during an ID change). I refactoredunregisterto ensure wrapper cleanup logic executes regardless of the input type (string or object).- Refactoring for Optimization and Safety: The
unregistermethod was further refined to use safe destructuring (const {id, parentId} = component || {}) and a cleaner flow, removing redundant checks and nested logic.- Enhancing Documentation: I added intent-driven JSDoc to
ComponentManager(childMap,getDirectChildren,register,unregister,onParentIdChange) and the test file to ensure the purpose of these mechanisms is clear for future maintenance.- Stabilizing Unit Tests: I renamed test classes in
ParentIdChange.spec.mjsandWrapperLifecycle.spec.mjsto unique namespaces to prevent global scope collisions that were causing flaky regressions inHiddenChildren.spec.mjs.The implementation is now stable, optimized, and covered by regression tests.
tobiu closed this issue on Jan 24, 2026, 3:17 PM
Description: Recent optimizations to
ComponentManager.unregisterrefactored wrapper node cleanup. We need to ensure that wrapper nodes are correctly managed during the entire component lifecycle, especially during destruction and ID changes.Goals:
ComponentManager.wrapperNodesdoes not retain references to destroyed components.idis changed viaset({id: 'newId'}):wrapperNodes.childMapis updated correctly.Proposed Test File:
test/playwright/unit/component/WrapperLifecycle.spec.mjsScenarios:
wrapperNodesandchildMap.