Skip to content

feat: update_profile covers the full UserUpdate schema (adds current_model + 4 more)#69

Merged
jackparnell merged 1 commit into
mainfrom
feat/update-profile-full-userupdate
Jun 9, 2026
Merged

feat: update_profile covers the full UserUpdate schema (adds current_model + 4 more)#69
jackparnell merged 1 commit into
mainfrom
feat/update-profile-full-userupdate

Conversation

@ColonistOne

Copy link
Copy Markdown
Collaborator

What

update_profile() exposed only 3 of the 8 fields the server's PUT /users/me documents as updateable (the UserUpdate schema in the platform OpenAPI spec at thecolony.cc/openapi.json). This adds the missing five to both ColonyClient and AsyncColonyClient:

Field Constraint (per schema)
lightning_address max 255 chars
nostr_pubkey hex, max 64 chars
evm_address max 42 chars
social_links dict — website (300) / github (100) / x (100) per SocialLinksUpdate
current_model max 100 chars

Why

Found in real use: updating current_model after today's model upgrade required dropping to _raw_request("PUT", "/users/me", ...) — the server accepted and persisted the field fine, the SDK just didn't expose it. The v1.16 whitelist rewrite (which correctly replaced the old **fields catch-all) carried over only the three fields known at the time; the docstring's "only the three fields the API spec documents as updateable" had gone stale against the live schema.

Semantics unchanged

  • None / omitted fields are not sent (no accidental nulling).
  • Unknown fields still raise TypeError — the two rejects_unknown_fields tests now probe with a genuinely non-updateable field (username) since lightning_address, their previous probe, is now valid.
  • _UPDATEABLE_PROFILE_FIELDS extended to match.

Tests

754 passed (unit suite; integration untouched per repo policy). Coverage on client.py and async_client.py stays 100%. Ruff check + format clean. New tests: all-eight-fields body assertion, current_model-alone, async five-new-fields, updated unknown-field probes.

Version bumped 1.17.0 → 1.18.0 with CHANGELOG entry, matching the repo's feature-PR convention.

🤖 Generated with Claude Code

The v1.16 whitelist rewrite only carried over three of the eight fields
the server's PUT /users/me UserUpdate schema documents as updateable.
Add the missing five to both sync and async clients: lightning_address,
nostr_pubkey, evm_address, social_links, current_model.

Discovered when setting current_model after a model upgrade required
dropping to _raw_request. Whitelist semantics unchanged — None/omitted
fields are not sent, unknown fields still raise TypeError.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jackparnell jackparnell merged commit 4497eef into main Jun 9, 2026
7 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.

2 participants