enhancement
major
minor
defect
critical
major
minor
major
#30165
React: A command with ignoreStaleUi to a control that left the display still fails with 404 "Control not found"
Problem
Leaving a page with a <chat-conversation> disposes its control; the chat's ChatStream.close() then sends detachStream with CommandOptions.ignoreStaleUi (#30126). ReactServlet.answerMissingControl answers with the code ERROR_CODE_STALE_UI only when the window has no controls at all; for one control that left the display it answers a plain 404 "Control not found: vNN" without code, and command-channel.ts logs it as a failed command ([TLReact] Command failed: 404 …).
Reproduced in tl-factory (Gitea TopLogic/tl-factory #39): log in, start page with a chat, click another sidebar item: {"controlId":"v64","command":"detachStream",…} → 404.
Change
The answers for a missing control (answerMissingControl, also the path after model events) carry an error code of their own; a command sent with ignoreStaleUi drops it silently, like the stale-UI code. Documented at CommandOptions.ignoreStaleUi and in the article view-layer/client-server-protocol.
Test
command-channel unit test: 404 with that code and ignoreStaleUi → no error, no console.error. ReactServlet: a command to a removed control of a window that still has controls answers 404 with the code.
Lösung
- ReactServlet.ERROR_CODE_CONTROL_GONE (control-gone, mirrored in command-channel.ts): every 404 "Control not found" of a window that still has controls carries it - a command after answerMissingControl, a command whose control left the display while the window caught up with the model, the state request of a control, an upload whose control left the display. One helper sends this answer. A window without any controls keeps answering stale-ui (the client reloads the page).
- command-channel.ts: control-gone with CommandOptions.ignoreStaleUi is dropped silently; without the option it is logged as a failed command as before, without reloading the page (the page is still valid, only its target is gone). The option keeps its name: both codes mean that the UI the command was sent from is outdated.
- Documented at CommandOptions.ignoreStaleUi and in view-layer/client-server-protocol.
- Tests: vitest of command-channel (control-gone with and without ignoreStaleUi), and a servlet test for a command to a removed control of a window that still has controls.