Skip to content

qt: move QtWebSocketBackend onto the structural registration surface and delete the WASM special case #568

Description

@Yaraslaut

Re-scoped out of #522, step 2 of 5. Blocked by #567 — the new surface must exist first.

Why this one is the heart of the set

QtWebSocketBackend is the only backend in the tree that overrides any of the four *Async verbs (src/qt/qt_websocket_backend.cpp:160, :226, :265, :368). Every other implementor — LocalBackend, SimulatedRemoteBackend, SocketBackend, and all 11 test doubles — inherits the defaulted return false and falls back to the synchronous path.

So the entire prose threading contract in backend.hpp:131-135 exists for exactly one class, and the WASM special case it describes lives here. #522's claim that "the WASM special case disappears rather than being a documented exception" is a claim about this file.

What to do

Move QtWebSocketBackend onto the surface from #567 natively — not through SynchronousBackendAdapter, which would defeat the point. It is the one backend that genuinely has a non-blocking path, and it should be the one that demonstrates the new shape carries it.

Then delete the WASM special case rather than re-documenting it.

Acceptance

  • QtWebSocketBackend implements the core: give IBackend a registration surface whose threading contract is structural, not prose #567 surface directly and overrides none of the four *Async verbs.
  • The single-threaded WASM registration path works with no special case in the interface — demonstrated by the existing coverage in tests/qt/test_qt_websocket.cpp and examples/common/testkit/test_wasm_registration_path_native.cpp.
  • The continuation is delivered on the thread the contract requires, and there is a test that fails if it is not. This is the morph#486 use-after-free the prose contract was guarding against; a migration that preserves the guarantee without testing it has moved the risk, not removed it.
  • include/morph/qt/qt_websocket_backend.hpp's documentation describes the new shape; the prose threading contract it used to restate is gone, not copied.

Notes

First ticket in the new Q qt-gui lane (include/morph/qt, src/qt, tests/qt), created for this set. Blocks #522's step 5. The example WASM mains are not in scope here — they are step 4, in the N ladder lane.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: qtSubsystem: qttriage: validWell-framed; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions