feat(mqtt-light): migrate MQTT subscriptions to /data/* topics#11
Merged
Conversation
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>
There was a problem hiding this comment.
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}/eventsanddevice/{id}/statustodevice/{id}/data/eventsanddevice/{id}/data/status. - Removed the legacy
device/{id}/responsesubscription and the unusedparseResponseMessagehandler. - 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
approved these changes
May 21, 2026
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.
Migrate to
/datatopics