Skip to content

Fix cuecue osc-output and the bugs that could stop a show - #6

Merged
phatshambler merged 2 commits into
developfrom
fix/cli-osc-output
Nov 17, 2026
Merged

phatshambler merged 2 commits into
developfrom
fix/cli-osc-output

Conversation

@phatshambler

Copy link
Copy Markdown
Member

Fixes cuecue osc-output and the bugs that could stop a show. Each bug was reproduced first (a test, or a script on the built packages), and each new test fails without its fix.

cuecue osc-output

It imported an OscOutput that @cuecue/osc doesn't export, never opened its OSC client, and called send(…, callback) and close(), which don't exist. It now sends the message, prints it, and exits with an error code when sending fails. Tested with a node-osc server, and with the built command.

What could stop a show

  • A failing output stopped the app. Outputs didn't return the promises of cue(), interact()…, and the app didn't await its sends: a rejection was unhandled, and Node exits on it. An HttpOutput to a server that is down stopped the app at start(). Now:
    • every output call goes through Application#sendToOutputs(), which catches and logs each failure (new logger option, console by default) without stopping the other outputs;
    • OSC, PubNub, HTTP and Socket.IO outputs return their promises; PubNub's failures reject with an Error (status.error is true, not an error);
    • a command from an input that fails is awaited and logged.
  • reset after end stopped the app (this.session is null), for example with POST /commands {"command":"reset"}. reset and resetInteractions are now ignored without a session, and so is the recovery of onIdle when the session ended meanwhile.
  • MySQL: a refused or lost connection emitted an unhandled error event, which stops the process, and destroy() always threw (this.debug is not a function, and a transition inside another one). The store now uses a mysql2 pool of one connection (same order of queries as before), which replaces a lost connection; destroy() ends it; autoConnect connects after init().

Wrong results

  • A cue's duration uncued the next cue: cue A (duration: 1), then cue B before A's end → B was uncued a second later. The duration now stops when another cue starts, and it is one timer instead of a check every 10 ms. after_duration: 'next' goes to the next cue of the session, so cues added with define count.
  • PubNub and Socket.IO inputs emitted the original command with the transformed arguments: a transformCommand that renames go to cue gave ["go", "intro"]. They now emit the transformed command.
  • Socket.IO ServerOutput passed the message as the namespace when transformCommand returned one.
  • OSC inputs and outputs threw when destroyed before init().

Not changed

  • POST /commands (like the app's default validateCommand) still accepts kill, without authentication.
  • HttpInput still has a hardcoded session secret.
  • The MySQL store is tested against a server that doesn't answer, not against a real database.

Checks

npm run format:check, npm run lint, npm run build, npm test: 82 tests on Node 24; 72 pass and 10 are skipped on Node 22. The scripts that stopped the process (HTTP output down, reset after end, MySQL down) now keep it running. Changesets: fix-cli-osc-output.md, fix-show-stoppers.md.

🤖 Generated with Claude Code

phatshambler and others added 2 commits November 17, 2026 10:25
It imported an OscOutput that @cuecue/osc doesn't export and never opened
its OSC client. It now sends the message, prints it, and exits with an error
code when sending fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- app: output failures are caught and logged (new logger option), and so are
  failed commands from inputs; reset after end is ignored; a cue's duration
  stops when another cue starts, and 'next' uses the session's cues
- outputs return their promises, so the app can catch their failures
- pubnub and socketio inputs emit the transformed command
- socketio ServerOutput sends to the namespace transformCommand returns
- osc plugins can be destroyed before init
- store-mysql: a pool of one connection, no crash on connection errors,
  destroy() works

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phatshambler
phatshambler merged commit d39e40e into develop Nov 17, 2026
3 checks passed
@phatshambler
phatshambler deleted the fix/cli-osc-output branch November 17, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant