fix(sdk/rust): repair user.profile canonical payload (crate fails to compile on main)#32
Conversation
|
@graycyrus is attempting to deploy a commit to the Vezures Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesSignature Payload Field Rename Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…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>
7cc1bd4 to
de87aa5
Compare
Problem
The Rust SDK does not compile on
main:users.rsbuilt the signeduser.profilecanonical payload from fields that were renamed onUserProfileUpdate(avatar→avatar_email,links→link) and never updated.Fix
Aligned the payload with the TypeScript source of truth (
sdk/typescript/src/api/users.ts→userProfileSignaturePayload). Beyond just compiling, this also fixes a latent signature bug: the Rust payload used the wrong key names and was missing theharnessKeykey 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 test✅ 396 passed, 0 failedNotes
This unblocks the
cargo publishworkflow (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 onmainundetected is exactly the gap tracked in #14 (no PR-gating CI for Rust).Fixes #30
🤖 Generated with Claude Code
Summary by CodeRabbit
avatarEmailandharnessKeyfields, and useslinkinstead of separate avatar and links fields for validation.