Problem
The current test added for the findController swap bug verifies that stale controllers no longer trigger rebuilds after a swap, but it does not cover the disposed-editor failure mode. Before the fix, a swapped-out findController could still call setState on a disposed CodeEditor after the editor was removed from the tree.
Why this matters
This is the more severe user-visible consequence of the listener leak. Without a regression test for the disposed-editor path, future refactors could accidentally reintroduce a setState() called after dispose() failure while still passing the current rebuild-focused test.
Success criteria
- Add a widget test that swaps the findController, disposes the editor, then triggers the stale controller
- The test fails without the production fix and passes with it
- The test does not rely on protected members like
hasListeners
Problem
The current test added for the findController swap bug verifies that stale controllers no longer trigger rebuilds after a swap, but it does not cover the disposed-editor failure mode. Before the fix, a swapped-out findController could still call
setStateon a disposedCodeEditorafter the editor was removed from the tree.Why this matters
This is the more severe user-visible consequence of the listener leak. Without a regression test for the disposed-editor path, future refactors could accidentally reintroduce a
setState() called after dispose()failure while still passing the current rebuild-focused test.Success criteria
hasListeners