Skip to content

fix: make update() return updated objects consistently#16

Merged
franccesco merged 3 commits intomainfrom
fix/update-return-consistency
Mar 20, 2026
Merged

fix: make update() return updated objects consistently#16
franccesco merged 3 commits intomainfrom
fix/update-return-consistency

Conversation

@franccesco
Copy link
Copy Markdown
Owner

Summary

Fixes a design inconsistency where goal.update() and headline.update() returned None, while todo.update() and issue.update() returned the updated entity. All four update() methods now re-fetch and return the updated object after the PUT call.

Changes

Operations

  • headline.update() now returns HeadlineDetails (was None)
  • goal.update() now returns GoalInfo (was None)
  • Added goal.details(goal_id) method (GET rocks/{goal_id}) to support the re-fetch pattern
  • Added _transform_goal_details() mixin method for single-goal response transformation
  • Applied same changes to async variants

Tests

  • Updated goal and headline update tests to assert returned objects instead of None
  • Added GET mocks for the post-update details() re-fetch
  • Added autouse fixture in adversarial tests for goal update GET mock

Test plan

  • All 516 tests pass
  • ruff format clean
  • ruff check clean
  • pyright strict mode clean
  • 98% coverage maintained

🤖 Generated with Claude Code

franccesco and others added 3 commits March 20, 2026 12:21
…ently

headline.update() and goal.update() returned None while todo.update() and
issue.update() returned the updated entity. Now all update() methods re-fetch
and return the updated object after the PUT call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adapt goal and headline update tests to expect returned objects instead of
None, and add GET mocks for the post-update details() re-fetch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@franccesco franccesco merged commit 49844b5 into main Mar 20, 2026
6 checks passed
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.

1 participant