Skip to content

Conversation

@jimsynz
Copy link
Contributor

@jimsynz jimsynz commented Dec 7, 2025

Remove the redundant protocol that only delegated to the module's schema/0 callback. The new macro handles all boilerplate:

  • Sets up @behaviour BB.Message
  • Compiles the schema via Spark.Options
  • Generates schema/0 callback and new/2 helper

Also fixes a race condition in command execution where state transitions happened asynchronously after completion events were published. Now uses synchronous GenServer.call to ensure state updates before subscribers receive events.

Net reduction of ~290 lines across 21 files.

… macro

Remove the redundant protocol that only delegated to the module's
`schema/0` callback. The new macro handles all boilerplate:
- Sets up `@behaviour BB.Message`
- Compiles the schema via `Spark.Options`
- Generates `schema/0` callback and `new/2` helper

Also fixes a race condition in command execution where state
transitions happened asynchronously after completion events were
published. Now uses synchronous `GenServer.call` to ensure state
updates before subscribers receive events.

Net reduction of ~290 lines across 21 files.
@jimsynz jimsynz merged commit 9b13345 into main Dec 7, 2025
14 checks passed
@jimsynz jimsynz deleted the message-simplification branch December 7, 2025 04:15
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.

2 participants