Skip to content

fix(update): reject empty update payloads before calling API#76

Merged
electather merged 1 commit intomainfrom
fix/reject-empty-update-payloads
Mar 16, 2026
Merged

fix(update): reject empty update payloads before calling API#76
electather merged 1 commit intomainfrom
fix/reject-empty-update-payloads

Conversation

@electather
Copy link
Owner

Summary

  • Tracks a changed boolean across optional flags in cmd/users/update, cmd/request/update, and cmd/mcp/tools_users UsersUpdateHandler
  • Returns "at least one field must be provided" error when no optional fields are set, so the API is never called with a no-op body
  • For the MCP handler, returns an IsError=true tool result (consistent with other MCP error handling in this codebase)

Test plan

  • TestUsersUpdateEmptyPayloadusers update 1 with no flags returns the expected error
  • TestRequestUpdateEmptyPayloadrequest update 42 --media-type movie with no optional fields returns the expected error
  • TestMCPUsersUpdateEmptyPayload — MCP users_update with only userId returns an error result
  • All existing tests continue to pass

Issue

Closes #68

Track a changed boolean across optional flags in users update, request
update, and the MCP users_update tool. Return an error when no optional
fields are provided so the API is never called with an empty body.
@electather electather merged commit e01aecf into main Mar 16, 2026
2 checks passed
@electather electather deleted the fix/reject-empty-update-payloads branch March 16, 2026 12:12
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.

refactor: Reject empty update payloads before calling update endpoints

1 participant