Repository navigation
test(app-server): await progress in the TypeScript session fixture - #2083
Conversation
`session_typescript::node_session_typescript_tools_methods_and_generation_lifetimes` expected the two `progress(...)` calls of one TypeScript method to reach the host in call order. Since rutis 0.23 (#1941) an imported callback invoked outside a synchronous call is dispatched asynchronously, and rutis-bridge runs each incoming call frame on its own task, so `settled` could be delivered before `started`, or `started` could be dropped when the reply closes the progress channel. Await both calls in `runtime/fixtures/session-part.ts` so each send completes before the next one and before the handler returns. The assertion and the other fixtures are unchanged. `npm/plugin.d.ts` and the plugin guide still describe `progress(...)` as a synchronous call; #2082 records those gaps for a separate change. Fixes #2082
eric8810
left a comment
There was a problem hiding this comment.
Reviewed at head ad83418.
The diagnosis is right and the fix is at the cause. Since rutis 0.23 a host callback invoked outside a synchronous call is dispatched asynchronously and each incoming call frame runs on its own task, so a fixture that sends started and then settled without awaiting either lets the two race — settled can arrive first, and started can be dropped when the reply closes the progress channel. Awaiting both calls makes each send complete before the next and before the handler returns, which restores the order the assertion describes rather than weakening it.
Leaving the assertion, the other fixtures, the type declarations and the guide untouched is the right scope: this is a fixture that made a call the runtime is entitled to treat as concurrent, not a product behaviour to change. It is also the failure I named on #2055 (node_session_typescript_tools_methods_and_generation_lifetimes), so it closes that flake at its cause rather than leaving it to reappear.
Blocking: none.
Checks are green at this head. I read the PR body and the single changed file's stat (2/2); I did not read the lines themselves or session-part.ts around them, and ran nothing.
Non-blocking:
runtime/fixtures/session-part.ts— if a plugin has to await each progress call to keep its notices ordered, that is a contract a plugin author will hit in production, not only in this fixture. The body says the plugin guide already covers the callback change; a sentence there stating that ordering across successive progress calls requires awaiting each one would turn this two-line fixture fix into the lesson for the next author.
zerob13
left a comment
There was a problem hiding this comment.
Reviewed ad83418. Awaiting the fixture callbacks preserves started before settled and the terminal reply, without weakening the progress assertions or changing runtime behavior. The callback queues or drops a frame without waiting for the client, so the report and drain cancellation assertions remain meaningful. Exact Linux CI passed the regression in the public Node bindings step. The authoring example and MethodProgress return type can be clarified separately.
Fixes #2082
session_typescript::node_session_typescript_tools_methods_and_generation_lifetimes(crates/dim-app-server/tests/transport_flow/session_typescript.rs:1595) expected the firstmanagement.progressnotice of asession.typescript.statuscall to carry{phase: "started"}. It failed in CI on 2026-11-23 withleft: String("settled"),right: "started".The
typescriptfixture (runtime/fixtures/session-part.ts:230,233) sentstarted, thensettled, then returned without awaiting either call. Since rutis 0.23 (#1941), a host callback invoked outside a synchronous call is dispatched asynchronously, and rutis-bridge runs each incoming call frame on its own task, so the two sends race:settledcan arrive first, andstartedcan be dropped when the reply closes the progress channel.The fixture now awaits both calls, so each send completes before the next one and before the handler returns. The assertion, the other fixtures,
npm/plugin.d.tsand the plugin guide are unchanged; #2082 records the remaining type and guide gaps for a separate change.Evidence, one process per run with
DIM_TEST_NODE,DIM_TEST_JS_RUNTIMEandDIM_TEST_RUTIS_SDKset:origin/maincecf65f: 100 runs, 99 passed, 1 failed at:1595withsettledandstarted.