Skip to content

Ask BC3 for presence-aware card step updates - #608

Merged
jeremy merged 1 commit into
mainfrom
contract/card-step-partial-updates
Aug 4, 2026
Merged

Ask BC3 for presence-aware card step updates#608
jeremy merged 1 commit into
mainfrom
contract/card-step-partial-updates

Conversation

@jeremy

@jeremy jeremy commented Aug 3, 2026

Copy link
Copy Markdown
Member

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).

Written for commit 4b52a45. Summary will update on new commits.

Review in cubic

`steps#update` builds a fresh `Step` from the request and calls
`replace_assignees` unconditionally, so an omitted `due_on` and an
omitted `assignee_ids` are both cleared by the server. Omission and
explicit clear are indistinguishable on the wire, which puts the fix
out of reach of any client change — including pointerizing the SDK
request, whose nil is omitted from the JSON either way.

`cards#update` already has the mechanism: `update_assignees?` tests
`has_key?`, and `recordable.changing` preserves unmentioned
attributes. Steps need both.

Refs #604

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b52a45fb5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


A deployed BC3 fix stops the data loss for every already-installed v0.8.x
client, with no CLI release, no SDK release, and nothing for users to upgrade.
The reverse is not true: no client release can fix it at all.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the available client-side mitigation

Do not conclude that no client release can address this active data loss. The two reported paths already fetch the current step: validateStep supplies the full step to doAssignStep, and the due-only update path calls CardSteps().Get; those values can be echoed into UpdateStepRequest to preserve DueOn and AssigneeIDs, following the repository's existing read-modify-write approach for todos. This remains vulnerable to concurrent edits and does not replace the proposed server fix, but it prevents the deterministic wipe without even adding a GET to these paths, so ruling it out leaves users exposed while waiting for BC3 deployment.

Useful? React with 👍 / 👎.

@jeremy
jeremy merged commit b6aa844 into main Aug 4, 2026
24 of 25 checks passed
@jeremy
jeremy deleted the contract/card-step-partial-updates branch August 4, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants