You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(gxt-backend): cap classic reactor cross-test fires at 100
Diagnostic instrumentation in CI run on commit 70c2124 confirmed
the leak signature: a classic-tag reactor registered in test A fires
1,000+ times during unrelated test B (and again during C, D, ...).
A real-app reactor never legitimately survives the test that
registered it; the lifetime cap at 10,000 (commit 29062f5) never
trips because each leaked reactor's per-foreign-test fires stay
under the lifetime threshold even though dozens of leaked reactors
each contribute thousands of fires.
This commit adds a per-foreign-test cap. ReactorMeta now tracks
foreignFires + foreignTest; when a reactor fires in a test that
differs from registeredAtTest, foreignFires increments (resetting
when the foreign test changes or when execution returns to the
registration test). At 100 foreignFires the reactor is unsubscribed
unconditionally.
100 is well below the observed leak signature (1,000+ foreign fires
per test) but well above any plausible legitimate cross-test
reactivity (real-app reactors don't outlive their owning test).
Tagging is now always-on (was diagnostic-only); the WeakMap put per
registration is cheap and the cap depends on the metadata.
Local cumulative reproducer: 17 CAP_FOREIGN events fired in 3
minutes, all hitting the cap at exactly 101 foreignFires before
unsub. Smoke (14 modules / 333 tests) green.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
0 commit comments