Draft
feat: add MQTT message validation per arena-docs spec#171
Conversation
Implements message validation checks in ArenaClientScene.Messaging.cs: - Section 2: Payload validation (empty/null, valid JSON, object_id present, object_id matches topic UUID) - Section 3: Message envelope validation (action presence and validity, data for create/update, type and object_type warnings) - Section 4: Self-message filtering (own userClient, own camera/hands) - Section 6: Security checks (goto-url/textinput blocking, camera- override/rig routing to own camera only, clientEvent source validation) Closes #170
- Wrap JObject.Parse in try-catch for malformed data gracefully - Wrap JsonConvert.DeserializeObject in try-catch in ClientEventOnObject - Move clientEvent null data check to ProcessArenaMessage to consolidate with create/update data checks, removing redundancy from ClientEventOnObject
Copilot
AI
changed the title
[WIP] Add message validation for MQTT in arena-unity
feat: add MQTT message validation per arena-docs spec
Jul 20, 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.
Arena-unity was missing all client-side MQTT message validation that arena-web-core already enforces. This adds the missing checks from the message-validation spec to
ArenaClientScene.Messaging.cs.Payload validation (Section 2)
object_idis missingobject_iddoesn't match topic UUID (position 6) — critical for security in concert with broker ACLMessage envelope validation (Section 3)
action(valid:create,update,delete,clientEvent,leave)dataforcreate/updateactionstypeor missingobject_typeon createsSelf-message filtering (Section 4)
userClient(topic position 5) — prevents feedback loopsSecurity (Section 6)
goto-urlandtextinputclientEventtypes from remote clientscamera-overrideandrigmessages if addressed to own camera (topic position 7 inlocalCameraIds)clientEventwhere deprecatedsourcefield doesn't match topictoUidMethod signature changes
ProcessArenaMessageandClientEventOnObjectnow accept an optionalstring[] topicSplitto carry topic context through the call chain without re-parsing.