Skip to content

Return updated board on PUT /boards/:id#2848

Open
robzolkos wants to merge 5 commits intobasecamp:mainfrom
robzolkos:board-update-returns-body
Open

Return updated board on PUT /boards/:id#2848
robzolkos wants to merge 5 commits intobasecamp:mainfrom
robzolkos:board-update-returns-body

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 16, 2026

Summary

The JSON response for PUT /:account_slug/boards/:board_id was 204 No Content, forcing clients to do a follow-up GET to observe the result of their own write. The Smithy contract the SDKs are generated from already declares UpdateBoard returns a Board, so the server was out of sync with the documented shape.

This changes the JSON update path to return the same payload shape as GET /:account_slug/boards/:board_id when the caller still has access after the update. If the update succeeds but removes the caller's own access to the board, the endpoint returns 204 No Content instead of returning a board they can no longer access. The HTML redirect behavior is unchanged.

Discovered via a fizzy-cli QA sweep — fizzy board update rendered an all-blank result because the CLI was parsing an empty body as a zero-valued Board.

Changes

  • app/controllers/boards_controller.rb
    • JSON board updates now render :show when access remains after the update
    • JSON board updates return 204 No Content when the update removes the caller's own access
  • test/controllers/boards_controller_test.rb
    • "update as JSON" test now asserts key fields on the returned body
    • added coverage for the self-removal JSON case
  • test/controllers/api/flat_json_params_test.rb
    • updated the flat JSON board update test to expect the returned board body
  • docs/api/sections/boards.md
    • documents the 200 OK response body for successful updates
    • documents the 204 No Content response when the update removes the caller's own access

Mobile App check

  • Neither mobile app has native client code calling PUT /boards/: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 board

The JSON response was `204 No Content`, forcing clients to make a
follow-up GET to observe their own write. The Smithy contract the
SDKs are generated from already declares `UpdateBoard` returns a
Board, so the server was out of sync with the documented shape.

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

Updated test asserts the returned body matches the updated state.
Updated API docs to show the 200 response shape.
Copilot AI review requested due to automatic review settings April 16, 2026 19:52
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 the PUT /:account_slug/boards/:board_id JSON behavior with the documented/contracted API shape by returning the updated Board payload (matching GET /:account_slug/boards/:board_id) instead of 204 No Content, avoiding a forced follow-up GET for clients.

Changes:

  • Return render :show for JSON updates to boards (instead of head :no_content).
  • Update controller test to assert returned JSON fields on update.
  • Update API docs to describe the 200 OK response body for board updates.

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.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
app/controllers/boards_controller.rb Changes JSON update response to render the board payload via the show view.
test/controllers/boards_controller_test.rb Updates the JSON update test to validate response body fields.
docs/api/sections/boards.md Updates API documentation to reflect 200 OK with board JSON on update.

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

Comment thread app/controllers/boards_controller.rb Outdated
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Updated the JSON self-removal case: successful board updates now return 200 with the board when access remains, and 204 No Content when the update removes the caller's own access. This preserves the success signal without returning a board the caller can no longer access.

Copilot AI review requested due to automatic review settings April 16, 2026 20:06
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

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


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

Comment thread app/controllers/boards_controller.rb
Comment thread docs/api/sections/boards.md
@robzolkos
Copy link
Copy Markdown
Collaborator Author

robzolkos commented Apr 17, 2026

@flavorjones we need to check this isn't affecting the mobile apps.

Edit - checked, and it does not.

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