Ask BC3 for presence-aware card step updates

Merged
JE
4mo ago
+203-0

Files a communiqué asking BC3 Rails for presence-aware steps#update. No CLI
code changes — the whole point is that there is no CLI fix.

Why

#604 reports live data loss on released v0.8.0/v0.8.1: assign --step wipes
due_on, and cards step update --due wipes assignees.

I originally read this as CLI-owned, then SDK-owned. Both were wrong.
app/controllers/steps_controller.rb settles it:

def update
  @recording.update! recordable: new_step
  @recording.replace_assignees find_assignees, notify: true

new_step is Step.new step_params — a fresh Step, so an omitted due_on
yields one without a due date. replace_assignees runs unconditionally, and
with no assignee_ids key assignee_ids falls through to "".split(",") →
[], so every assignee is removed. Both clears are server-side, driven by the
absence of a key.

That means omission and explicit-clear are the same request on the wire.
Pointerizing UpdateStepRequest.DueOn does not help: a nil *string is
omitted from the JSON, and the controller clears on that omission. The server
has to become presence-aware before any client change can matter.

What it asks for

cards#update already carries half the answer — update_assignees? guards on
has_key?, and recordable.changing(...) preserves unmentioned attributes.
The communiqué asks for both in steps#update, plus tests for due-only
preservation, assignee-only preservation, and explicit clear (a fix that
guards on blankness rather than key presence passes the first two and breaks
the third).

It also raises a question rather than assuming: card_update_params nils
due_on on omission deliberately, per its own comment — so cards have the
same due_on behaviour intentionally. We ask whether that intent extends to
JSON API callers.

Why server-side is the right lane

A deployed BC3 fix stops the bleeding for every already-installed v0.8.x client
with no CLI release, no SDK release, and nothing for users to upgrade. No
client release can fix it at all.

Not in this PR

  • CLI card-step code stays unchanged pending the Rails fix
    (internal/commands/cards.go, internal/commands/assign.go).
  • SDK pointer semantics on UpdateStepRequest is a dependent follow-up — what
    lets a client express omit-vs-clear once the server honours it. Inert on
    its own.

#604's body has been corrected to say Rails-first.

Refs #604


Summary by cubic

Adds a communiqué requesting presence-aware steps#update in BC3 Rails to prevent wiping due_on and assignees when those fields are omitted. Proposes using recordable.changing and guarding assignee updates like cards#update; no CLI or SDK changes in this PR (addresses #604).