Skip to content

fix(sdk/rust): repair user.profile canonical payload (crate fails to compile on main)#32

Merged
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/rust-users-profile-payload
Jun 16, 2026
Merged

fix(sdk/rust): repair user.profile canonical payload (crate fails to compile on main)#32
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/rust-users-profile-payload

Conversation

@graycyrus

@graycyrus graycyrus commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Problem

The Rust SDK does not compile on main:

error[E0609]: no field `avatar` on type `&user::UserProfileUpdate`  --> src/api/users.rs:76
error[E0609]: no field `links` on type `&user::UserProfileUpdate`   --> src/api/users.rs:80

users.rs built the signed user.profile canonical payload from fields that were renamed on UserProfileUpdate (avataravatar_email, linkslink) and never updated.

Fix

Aligned the payload with the TypeScript source of truth (sdk/typescript/src/api/users.tsuserProfileSignaturePayload). Beyond just compiling, this also fixes a latent signature bug: the Rust payload used the wrong key names and was missing the harnessKey key entirely, so even a compiling version would have produced signatures the backend rejects.

Signed keys now match TS exactly: actorType, avatarEmail, bio, cryptoId, displayName, harnessKey, link, tags.

Validation (from sdk/rust/)

  • cargo fmt --check
  • cargo build
  • cargo clippy --all-targets -- -D warnings
  • cargo test396 passed, 0 failed

Notes

This unblocks the cargo publish workflow (publish-rust-sdk.yml) — which cannot publish a non-compiling crate — and is a prerequisite for the other queued Rust SDK PRs. The fact that this landed on main undetected is exactly the gap tracked in #14 (no PR-gating CI for Rust).

Fixes #30

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated the canonical user profile payload structure used for request signing. The signature now includes avatarEmail and harnessKey fields, and uses link instead of separate avatar and links fields for validation.

@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

@graycyrus is attempting to deploy a commit to the Vezures Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@graycyrus, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 4 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bfa8e8d2-72e7-4e4a-b143-38318efd3126

📥 Commits

Reviewing files that changed from the base of the PR and between 7cc1bd4 and de87aa5.

📒 Files selected for processing (1)
  • sdk/rust/src/api/users.rs
📝 Walkthrough

Walkthrough

The user_profile_signature_payload function in the Rust SDK is updated to align the canonical JSON payload with the current UserProfileUpdate struct. The stale avatar and links fields are replaced with avatarEmail, harnessKey, and link.

Changes

Signature Payload Field Rename Fix

Layer / File(s) Summary
Canonical payload field rename
sdk/rust/src/api/users.rs
Replaces "avatar": or_null(&update.avatar) and "links": arr_or_null(&update.links) with "avatarEmail", "harnessKey", and "link" to match the renamed fields on UserProfileUpdate, restoring compilation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 A field called avatar had gone away,
And links was now link — hip hooray!
avatarEmail, harnessKey too,
The payload was fixed, good as new.
No more compile errors today! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: fixing a compilation failure in the Rust SDK by correcting the user.profile canonical payload to use the correct field names.
Linked Issues check ✅ Passed The PR fixes the compilation errors in users.rs by updating field references from avatar/links to avatar_email/link and aligns the canonical JSON payload with TypeScript SDK source of truth, directly addressing Issue #30 requirements.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the canonical payload in users.rs to correct field references and JSON key names, with no unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

…match TS

`users.rs` built the signed `user.profile` canonical payload from fields that
no longer exist on `UserProfileUpdate` (`avatar`, `links`), failing to compile
(E0609). It also diverged from the TypeScript source of truth: the wrong key
names and a missing `harnessKey` key would have produced invalid signatures.

Align the payload with `sdk/typescript/src/api/users.ts`
(`userProfileSignaturePayload`): keys `avatarEmail`, `link` (singular), and the
previously-missing `harnessKey`, mapping the matching struct fields
(`avatar_email`, `link`, `harness_key`).

Fixes #30

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@graycyrus
graycyrus force-pushed the fix/rust-users-profile-payload branch from 7cc1bd4 to de87aa5 Compare June 16, 2026 10:45
@graycyrus
graycyrus merged commit 0ea9197 into tinyhumansai:main Jun 16, 2026
7 of 8 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.

[Rust SDK] Crate fails to compile on main — users.rs references renamed UserProfileUpdate fields

1 participant