Skip to content

move response topic default off $SYS + reactive peer-mode design doc#11

Merged
fabracht merged 3 commits intomainfrom
fix/response-topic-default
May 3, 2026
Merged

move response topic default off $SYS + reactive peer-mode design doc#11
fabracht merged 3 commits intomainfrom
fix/response-topic-default

Conversation

@fabracht
Copy link
Copy Markdown
Contributor

@fabracht fabracht commented May 3, 2026

Summary

  • Default responseTopicPrefix moved from $SYS/responses to $DB/clients. The MQTT 5 spec (§4.7.2) reserves $-prefixed topics for broker-internal use; production brokers (EMQX, HiveMQ, AWS IoT Core) reject client publishes under $SYS by default ACL. The field remains fully configurable — deployments depending on the old default can preserve behavior by setting responseTopicPrefix: '$SYS/responses' explicitly.
  • Replaced the brittle response-topic regex parser in handleResponseMessage with a startsWith-based check. The old regex prepended \$ to the prefix, which only worked when the prefix started with $ — any non-$ override produced an invalid regex (\r was interpreted as carriage return).
  • Added docs/design/reactive-peer-mode.md — design doc for an upcoming peer-coordinated sync mode that lets stitch run against a plain MQTT broker without MQDB. Not implemented; for review.

Breaking change

Default responseTopicPrefix changed. Documented in CHANGELOG.md under Unreleased. Deployments overriding the field explicitly are unaffected.

Test plan

  • npm run check (typecheck + lint + format + 35 tests) passes
  • node scripts/verify-changelog.mjs passes
  • Verify against a frontend that currently overrides responseTopicPrefix explicitly — should be unaffected
  • If a deployment relies on the old default, broker ACLs will need to accept $DB/clients/... (or set responseTopicPrefix: '$SYS/responses' to preserve)

@fabracht fabracht merged commit 8b6ae97 into main May 3, 2026
4 checks passed
@fabracht fabracht deleted the fix/response-topic-default branch May 3, 2026 18:03
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