Repository navigation
Add tests across the packages, and fix what they found - #7
Merged
Merged
Conversation
- Cueing a cue that doesn't exist no longer puts the app in the cued state - resetInteractions() deletes interactions with the memory store too - getInteractionsByUser() and getInteractionsByInteractionId() look interactions up by id: GET /interactions with X-User-Id found none - POST /cues/define takes an array of cues Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- app: lifecycle, sessions and their recovery, cues, define, interactions, inputs; MemoryStore - core: BasePlugin, BaseInput, store parsers - http: every API route, HttpOutput requests - osc and socketio: inputs and outputs over real ports - store-mysql: against a real MySQL when MYSQL_TEST_* are set, run in CI on MySQL 8.4 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A migration adds a JSON extra column to sessions, cues and interactions. The store reads each table's columns once, keeps the other fields of an item in extra, merges them back on read, and looks items up by them with JSON_EXTRACT (an interaction's cueId). Cues with interaction, duration or after_duration failed with "Unknown column", and getInteractionsByCue() did too. Without the migration, the store says to run it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds tests across the packages, a CI job for the MySQL store, and the fixes for the bugs the tests found, including the MySQL store's missing columns. It sits on #6: merge #6 first, then this one goes to
develop.Tests
From 82 to 147 tests (Node 24, with MySQL). Each new test was checked against a deliberate break of the code it covers (11 mutations, all caught but one that doesn't change behaviour).
@cuecue/app: the lifecycle (start, cue/uncue, stop and start again in the same session, end and a new session, reset, commands its state doesn't allow), the commands sent to outputs (cues,start,state,cue,uncue,end), the recovery of a started session and its cue from the store,define(), cues kept apart per session, interactions (ids, updates, ties to a cue withinteraction: true,resetInteractions), inputs (validateCommand,inputCommands,transformCommand,removeInput).MemoryStore.@cuecue/core:BasePlugin's lifecycle and events,BaseInput, the store parsers.@cuecue/http: every API route (/cues,/cues/current,/cues/:id,/cues/:id/interactions,/cues/define,/uncue,/interactionswith and withoutX-User-Id,/session/*,/app/state,/export/*.jsonand.csv), andHttpOutput's requests (method, headers,transformMessage, cancelled and refused commands).@cuecue/osc:OscInputandOscOutputover UDP with node-osc: paths and commands,transformCommand(with several messages),acceptCommand, the arguments OSC can't carry.@cuecue/socketio:ClientOutput→ServerInputandServerOutput→ClientInputon real ports,commands.@cuecue/store-mysql: against a real MySQL whenMYSQL_TEST_*are set: items by id, matching, soft deletes, JSON data, and an application from start to end. CI runs them in a new job on MySQL 8.4, after the migrations. Locally, they ran on a throwaway MySQL 26.10.Bugs found and fixed
A missing cue put the app in the
cuedstate, and told the outputs so: the state machine doesn't cancel a transition when an async hook returnsfalse.cue()now checks the cue first.resetInteractions()deleted nothing with the memory store: it matchedexternalId, MySQL's column. It matchesid, which the MySQL store maps toexternalId.GET /interactionswithX-User-Idalways returned[]:getInteractionsByUser()matched auserIdthat interactions don't have, andgetInteractionsByInteractionId()aninteractionId. Both match the interaction's id, which is the user's withPOST /interactions.POST /cues/definewith an array of cues defined the array as one cue. It takes an array or a single cue.The MySQL store only stored the columns of its migrations: a cue with
interaction,durationorafter_durationfailed with "Unknown column", and interactions had nocueId, sogetInteractionsByCue()failed too. A new migration (20261117120000-extra.js) adds a JSONextracolumn tosessions,cuesandinteractions. The store reads each table's columns once (SHOW COLUMNS), keeps the other fields of an item inextra, gives them back as fields of the item, updates them withJSON_MERGE_PATCH, and finds items by them withJSON_EXTRACT. Without the migration, it says to run it. Apps on MySQL need to run the migrations (npm run migrate:up -w @cuecue/store-mysql); the migration goes down cleanly.Checks
npm run format:check,npm run lint,npm run build,npm test: 147 tests on Node 24 with MySQL; 131 pass and 16 are skipped (Pingpong and MySQL) on Node 22. Changesets:fix-cues-and-interactions.md,mysql-extra-column.md.🤖 Generated with Claude Code