Add ApprovalPolicy support to controller toWasmPolicies#2372
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
The keychain's toWasmPolicies creates ApprovalPolicy for approve methods with spender/amount fields, but the controller SDK always created CallPolicy. This caused merkle root mismatches for SessionConnector, NodeProvider, and TelegramProvider users who define approve policies with spending limits. Changes: - Add ApprovalPolicy handling to match keychain implementation - Update SessionContracts type to include Approval methods - Add comprehensive tests for ApprovalPolicy handling Fixes #2370 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0990907 to
6dbbec2
Compare
|
Claude finished @kronosapiens's task —— View job Documentation Updates for ApprovalPolicy ChangesTodo List:
Analysis SummaryThe PR #2372 fixed a critical bug where the controller SDK's Documentation Updates MadeI've updated the documentation to include the required Files Updated:
Key Changes:
The changes are staged and ready to commit, but I need permission to configure git user settings for the docs repository. |
Updates documentation to reflect changes made in:
Add ApprovalPolicy support to controller toWasmPolicies
Related controller PR: cartridge-gg/controller#2372
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Added specialized controller toast functionality (#2358) - Added ApprovalPolicy support fix (#2372) - Added session creation aggregation fix (#2304) - Updated release date to 2026-02-05 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Daniel Kronovet <undefined@users.noreply.github.com>
Summary
The controller SDK's
toWasmPoliciesfunction was missingApprovalPolicyhandling that exists in the keychain implementation. This caused merkle root mismatches for:SessionConnector(native/Capacitor apps)NodeProvider(Node.js server-side)TelegramProvider(Telegram mini-apps)When these connectors are used with approve policies that include
spenderandamountfields, the session registration (via keychain) would createApprovalPolicyobjects, while session usage (via controller SDK) would createCallPolicyobjects. This resulted in different merkle roots and "session/not-registered" errors.Changes
ApprovalPolicyhandling topackages/controller/src/utils.tsto match keychain implementationSessionContractstype inpackages/controller/src/policies.tsto properly includeApprovalmethodsTest plan
Fixes
Closes #2370
🤖 Generated with Claude Code