Skip to content

feat(mqtt-light): migrate MQTT subscriptions to /data/* topics#11

Merged
alvinometric merged 1 commit into
mainfrom
feat/migrate-to-data-status
May 21, 2026
Merged

feat(mqtt-light): migrate MQTT subscriptions to /data/* topics#11
alvinometric merged 1 commit into
mainfrom
feat/migrate-to-data-status

Conversation

@gregyoto
Copy link
Copy Markdown
Contributor

@gregyoto gregyoto commented May 21, 2026

Migrate to /data topics

The Public User JWT policy issued by yoto-api-authorizer will soon
restrict subscriptions to device/{id}/data/* (per RFC-79 / OS-2243).
This sample is linked from https://yoto.dev/get-started/sample-apps/
so it must lead the migration before the authorizer change ships.

Changes:
- Subscribe to device/{id}/data/events (was device/{id}/events)
- Subscribe to device/{id}/data/status (was device/{id}/status)
- Drop the device/{id}/response subscription entirely
- Update message routing to match topic suffix (handles the new
  /data/ path segment)
- Remove the unused parseResponseMessage stub

The ESP firmware dual-publishes to both legacy and /data/* topics
during the transition (mqtt_glue.c:193-198 for status,
app_events.c:98-99 for events), so this is safe to ship ahead of
the authorizer change.

The existing publishes to device/{id}/command/ambients and
device/{id}/command/events are unchanged.

Refs: https://yotoplay.atlassian.net/browse/OS-2243

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the mqtt-light sample app to subscribe to the new public MQTT topic surface (device/{id}/data/*) so it continues to work once legacy topic subscriptions are denied by authorizer policy changes.

Changes:

  • Migrated subscriptions from device/{id}/events and device/{id}/status to device/{id}/data/events and device/{id}/data/status.
  • Removed the legacy device/{id}/response subscription and the unused parseResponseMessage handler.
  • Updated message routing logic to match on the new topic suffixes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alvinometric alvinometric merged commit ad13404 into main May 21, 2026
5 checks passed
@alvinometric alvinometric deleted the feat/migrate-to-data-status branch May 21, 2026 13:53
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.

3 participants