这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Fix GetPropertyDataReply to send proper JSON header instead of empty content

Problem

The C++ Messenger class was sending invalid GetPropertyDataReply messages with both header and body as empty, which violates the MIDI-CI Property Exchange specification.

Solution

Modified PropertyHostFacade::process_get_property_data() to return a proper JSON header with error status when no property rules are configured, matching the Kotlin implementation behavior.

Changes

  • PropertyHostFacade.cpp: Updated process_get_property_data() method to create proper JSON header with PropertyExchangeStatus::RESOURCE_UNAVAILABLE_OR_ERROR status
  • Added necessary includes for JSON handling and PropertyExchangeStatus
  • Uses the same pattern as TestPropertyRules::get_property_data() for consistent JSON header creation

Testing

  • ✅ Code compiles successfully with no errors
  • ✅ Follows the established pattern from existing test implementations
  • ✅ Matches Kotlin implementation behavior of returning structured responses instead of empty content

Technical Details

The fix ensures that when no property rules are set, instead of returning empty header/body (which is invalid), the C++ implementation now returns:

  • Header: JSON object with resource ID, error status code, and descriptive message
  • Body: Empty (valid when no property data is available)

This matches the Kotlin implementation's approach of always providing structured responses rather than empty content.

Link to Devin run: https://app.devin.ai/sessions/e13a8a5bc47d4ebf8f8c0b2cbd93d6a2

Requested by: Atsushi Eno (atsushieno@gmail.com)

…content

- PropertyHostFacade::process_get_property_data now returns proper JSON header with error status when no property rules are set
- Matches Kotlin implementation behavior of returning structured responses
- Fixes issue where both header and body were sent as empty, which is invalid
- Uses PropertyExchangeStatus::RESOURCE_UNAVAILABLE_OR_ERROR for consistent error reporting

Co-Authored-By: Atsushi Eno <atsushieno@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 2 commits June 19, 2025 15:36
- Add CommonRulesPropertyService class implementing MidiCIServicePropertyRules interface
- Initialize property_rules_ in PropertyHostFacade constructor with CommonRulesPropertyService
- Implement getPropertyData with proper device info, channel list, and resource list JSON responses
- Add all required interface methods: get_property_id_for_header, create_update_notification_header, etc.
- Use CommonRulesKnownMimeTypes::APPLICATION_JSON for proper MIME type constants
- Remove temporary fix since service now handles all property requests with structured responses
- Follows Kotlin implementation pattern for property data exchanges with proper status codes

Co-Authored-By: Atsushi Eno <atsushieno@gmail.com>
- Change get_property_ids() to return JSON_SCHEMA in default property list
- Add create_json_schema_json() method to handle JSON schema property
- Handle RESOURCE_LIST as special case that returns complete metadata list
- Update get_metadata_list() to work with abstract PropertyMetadata class
- Matches Kotlin implementation behavior exactly

Co-Authored-By: Atsushi Eno <atsushieno@gmail.com>
@atsushieno atsushieno merged commit 25a4837 into main Jun 19, 2025
2 of 3 checks passed
@atsushieno atsushieno deleted the devin/1750345070-fix-get-property-data-reply branch June 19, 2025 15:56
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