fix(cards): carry over step title when updating assignees or due date

Merged
NN
5mo ago
+199-0

Problem

basecamp cards step update <id> --assignees <person> always fails with 400 Bad Request. Same for basecamp assign <id> --step and basecamp unassign <id> --step.

The server rejects a step update whose body has no title key, even though the API docs list every parameter as optional. All three code paths sent {"assignee_ids": [...]} with no title, so every assignee-only or due-date-only update failed. The same request with the current title included succeeds.

Fix

Carry over the current title when the caller does not provide a new one:

  • cards step update: when invoked without a new title, fetch the step first and reuse its title.
  • assign --step / unassign --step: pass the title of the step object these paths already fetch. No extra request.

Tests

Added two unit tests with a capturing mock transport: assignee-only updates fetch the step once and send its current title, and explicit-title updates skip the fetch and send the new title as-is. bin/ci is green.


Summary by cubic

Carry over the current step title when updating only assignees or the due date to prevent 400 Bad Request errors. This fixes basecamp cards step update, basecamp assign --step, and basecamp unassign --step when no new title is given.

  • Bug Fixes
    • cards step update: if no title is provided, fetch the step and include its current title in the update.
    • assign --step / unassign --step: include step.Title in the update without extra requests; send assignee_ids: [] explicitly on unassign.
    • Tests: coverage for assign/unassign title carry-over; assignees-only and due-only step updates carry the title; explicit-title updates skip fetching; assert single-step endpoint (suffix match); fail on unexpected routes; echo title in mock responses; surface mock IO errors.