Group of 2 Under the hood
Remote Control's request handling now goes through a general answerSharedControlRequest step before falling back to per-type handling
What
Remote Control's connection options previously had a specific onGetUsage callback just for usage queries. This has been replaced with a more general answerSharedControlRequest callback that can handle more kinds of requests.
- The remote-bridge connection options now expose
answerSharedControlRequestin place of the olderonGetUsagecallback. - Before the control bridge dispatches a
control_requestto its specific handler (for things likeinitializeorset_model), it first callsanswerSharedControlRequeston the request. If that returns a promise, the request is handled asynchronously; if it returns a result right away, acontrol_responseis sent immediately without running the normal per-type handling.
Why
This generalizes what used to be a single-purpose usage-query callback into a reusable path for answering various control requests, making it easier to add new request types without special-casing each one in the dispatch logic.