Files
66903aa4dc soundcraft-web: window.soundcraft, the page command API from craft-web-api (#1468)
* soundcraft-web: window.soundcraft, the page command API from craft-web-api

The web build had no control channel. It now installs window.soundcraft (request, execute, commands, docInspect, uiInspect, screenshot) from craft-web-api (storytold/craft-libs#413): the shell queues each call as a control request, the channel the desktop control server uses, and the app answers it on its next frame. SoundCraft's control requests cannot be withdrawn, so a call that times out in the page still runs when the app reaches it.

* soundcraft-web: the page wait ends with an error when the page has no timer

The wait for the app polled with a timer; with no window, or a timer the page refuses, the promise never settled and the wait hung. sleep now says whether a timer was set, and the wait ends the call with an error when none was, which releases the request.

* soundcraft-web: a real-browser check of window.soundcraft

apps/soundcraft-web/tests/page-api.mjs serves a built copy of the site, loads it in headless Chromium and drives all six functions, a command that changes the session, the rejection of an unknown method and of an unknown command, the screenshot and several calls at once. It is run by hand and is not part of cargo xtask ci. The README says how to run it.

* soundcraft-web: the browser check requires both docInspect calls to resolve before comparing

A rejected docInspect after track.new left its value undefined, which compared as a change.

* soundcraft-web: bound the calls waiting for the app, and test a burst

The queue behind window.soundcraft was unbounded and the pinned craft-web-api had no limit of its own, so a page loop could queue calls without end, including while the app was not draining.

craft-web-api is now pinned at the commit that refuses calls beyond an in-flight limit (craft-libs#733), and the queue of the app itself is bounded at 64 requests too: one more is refused at once with a busy error, and the call rejects. The browser check sends a burst of 300 calls and expects the ones over the limit to be refused as busy, the ones within it answered, and a later call accepted again.

* soundcraft-web: name SoundApp in the page API install comment

The install docs referred to WordApp::with_control, a leftover from the shared page API pattern.

---------

Co-authored-by: skylartaylor <hi@skylar.cc>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-28 22:48:29 +01:00
..