feat: update_profile covers the full UserUpdate schema (adds current_model + 4 more)#69
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
update_profile()exposed only 3 of the 8 fields the server'sPUT /users/medocuments as updateable (theUserUpdateschema in the platform OpenAPI spec atthecolony.cc/openapi.json). This adds the missing five to bothColonyClientandAsyncColonyClient:lightning_addressnostr_pubkeyevm_addresssocial_linkswebsite(300) /github(100) /x(100) perSocialLinksUpdatecurrent_modelWhy
Found in real use: updating
current_modelafter 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**fieldscatch-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).TypeError— the tworejects_unknown_fieldstests now probe with a genuinely non-updateable field (username) sincelightning_address, their previous probe, is now valid._UPDATEABLE_PROFILE_FIELDSextended to match.Tests
754 passed (unit suite; integration untouched per repo policy). Coverage on
client.pyandasync_client.pystays 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