Skip to content

Return updated comment on PUT /cards/:n/comments/:id#2852

Open
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:comment-update-returns-body
Open

Return updated comment on PUT /cards/:n/comments/:id#2852
robzolkos wants to merge 1 commit intobasecamp:mainfrom
robzolkos:comment-update-returns-body

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 17, 2026

Summary

The JSON response for PUT /:account_slug/cards/:card_number/comments/:comment_id was 204 No Content, which conflicted with both the API docs ("Returns the updated comment") and the Smithy contract the SDKs are generated from, which declares UpdateComment returns a Comment.

Rendering the show template on the JSON path makes the response match what the docs and spec already advertise. The Turbo Stream path is unchanged.

Discovered during a fizzy-cli QA sweep — same class of issue as #2848, #2849, #2851.

Changes

  • app/controllers/cards/comments_controller.rbformat.json { head :no_content }format.json { render :show }
  • test/controllers/cards/comments_controller_test.rb — both "update as JSON" tests now assert the returned body (id, body plain_text, creator)
  • No docs change: docs/api/sections/comments.md already reads "Returns the updated comment."

Mobile App check

  • Neither mobile app has native client code calling PUT /cards/:n/comments/:id
  • Neither mobile app has code paths that depend on this endpoint returning 204 No Content
  • Neither mobile app is affected by this response change to 200 OK with the updated comment

…omments/:comment_id

The JSON response was `204 No Content`, which conflicted with both
the API docs ("Returns the updated comment") and the Smithy
contract the SDKs are generated from (`UpdateCommentResponseContent`).

Render `show` for the JSON format so PUT returns the same payload
as GET. The Turbo Stream format is unchanged.

Docs already describe the correct response shape, so no doc change
is needed here. Tests now assert the returned body content.
Copilot AI review requested due to automatic review settings April 17, 2026 13:06
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns PUT /:account_slug/cards/:card_number/comments/:comment_id JSON behavior with the API docs and Smithy contract by returning the updated comment payload (instead of 204 No Content) after a successful update.

Changes:

  • Update comments JSON update response to render the show representation (200 OK with body).
  • Expand controller tests for JSON updates to assert key fields in the returned response body.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/controllers/cards/comments_controller.rb Switches JSON update response from 204 to rendering :show so clients receive the updated comment.
test/controllers/cards/comments_controller_test.rb Updates JSON update tests to validate the returned comment JSON fields (id/body/creator).

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@robzolkos robzolkos requested a review from flavorjones April 17, 2026 17:27
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