Commit ef6ce28
fix(gxt): tie classic-tag reactors to instance/owner destroy chains
Three idiomatic hooks for the classic-tag reactor leak path that
diagnostic instrumentation (commit 34f9515) confirmed:
1. renderLinkToElement (manager.ts:9519): the LinkTo instance owns
the reactor's lifetime. Eager unsub via Phase 0 of
__gxtDestroyTrackedInstances + willDestroy override on the
instance. The Phase 0 path matters because Ember's classic
destroy chain is async via the runloop, and willDestroy can fire
too late to prevent the reactor from leaking across the
testStart/testDone boundary.
2. _renderComponentGxt (renderer.ts:2287): split doDestroy into
cleanupReactor (reactor unsub only, no DOM) and full doDestroy
(also wipes innerHTML). Caller-invoked result.destroy() runs the
full path; owner-destruction cascades fire only the reactor
cleanup so a synthetic owner's destroy doesn't wipe a target the
caller still needs.
3. _gxtPendingRenderCleanups (renderer.ts): a global Set drained by
__gxtCleanupActiveComponents (the existing cleanup hook fired by
QUnit testStart and test-case afterEach). This is the layer that
actually catches the synthetic-owner case: the renderComponent API
documents `owner = {}` as the default, that synthetic plain object
is never in any destroy chain, so registerDestructor on it records
the destructor but it never runs. The pending-cleanup set fires
eagerly at known cleanup boundaries regardless.
For renderer.ts the wiring also includes the standard
associateDestroyableChild(parentOwner, syntheticOwner) so that callers
who DO destroy their owner properly cascade through the synthetic.
That's the same pattern as the classic GlimmerVM render path
(line 2330) — kept for callers with real destroyable owners.
Diagnostic instrumentation remains in the branch (commit 34f9515)
behind __GXT_LEAK_DEBUG__. Force-enable still set in index.html for
this CI run; will be flipped off once CI confirms the fix.
Smoke (14 modules / 333 tests) green. Local cumulative reproducer
shows leak count reduced significantly (LinkTo source from runaway
to bounded; renderComponent source partially drained — testem CI
tests will show whether the remaining tail still causes test
failures vs the prior 8-failure + browser-hang baseline).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 62cbad8 commit ef6ce28
3 files changed
Lines changed: 164 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1746 | 1746 | | |
1747 | 1747 | | |
1748 | 1748 | | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
1749 | 1833 | | |
1750 | 1834 | | |
1751 | 1835 | | |
| |||
1779 | 1863 | | |
1780 | 1864 | | |
1781 | 1865 | | |
| 1866 | + | |
1782 | 1867 | | |
1783 | 1868 | | |
1784 | | - | |
1785 | | - | |
1786 | | - | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1787 | 1878 | | |
1788 | 1879 | | |
1789 | 1880 | | |
| |||
1792 | 1883 | | |
1793 | 1884 | | |
1794 | 1885 | | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
1795 | 1894 | | |
1796 | 1895 | | |
1797 | 1896 | | |
| |||
1866 | 1965 | | |
1867 | 1966 | | |
1868 | 1967 | | |
1869 | | - | |
1870 | | - | |
1871 | | - | |
1872 | | - | |
1873 | | - | |
1874 | | - | |
| 1968 | + | |
1875 | 1969 | | |
1876 | 1970 | | |
1877 | 1971 | | |
| |||
2183 | 2277 | | |
2184 | 2278 | | |
2185 | 2279 | | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | | - | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
| 2280 | + | |
2193 | 2281 | | |
2194 | 2282 | | |
2195 | 2283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5784 | 5784 | | |
5785 | 5785 | | |
5786 | 5786 | | |
| 5787 | + | |
| 5788 | + | |
| 5789 | + | |
| 5790 | + | |
| 5791 | + | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
5787 | 5797 | | |
5788 | 5798 | | |
5789 | 5799 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4134 | 4134 | | |
4135 | 4135 | | |
4136 | 4136 | | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
4137 | 4157 | | |
4138 | 4158 | | |
4139 | 4159 | | |
| |||
9517 | 9537 | | |
9518 | 9538 | | |
9519 | 9539 | | |
| 9540 | + | |
| 9541 | + | |
| 9542 | + | |
| 9543 | + | |
| 9544 | + | |
| 9545 | + | |
| 9546 | + | |
| 9547 | + | |
| 9548 | + | |
| 9549 | + | |
| 9550 | + | |
| 9551 | + | |
| 9552 | + | |
| 9553 | + | |
| 9554 | + | |
| 9555 | + | |
| 9556 | + | |
| 9557 | + | |
| 9558 | + | |
| 9559 | + | |
| 9560 | + | |
| 9561 | + | |
| 9562 | + | |
| 9563 | + | |
| 9564 | + | |
| 9565 | + | |
| 9566 | + | |
| 9567 | + | |
| 9568 | + | |
| 9569 | + | |
9520 | 9570 | | |
9521 | 9571 | | |
9522 | 9572 | | |
| |||
0 commit comments