Skip to content

Conversation

joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 19, 2025


PR-Codex overview

This PR focuses on improving error handling for 7702 transactions in the thirdweb package by throwing a specific error when the queueId is not present in the response.

Detailed summary

  • Added error handling for 7702 transactions in packages/thirdweb/src/wallets/smart/lib/bundler.ts.
  • Introduced a new error message: Error executing 7702 transaction: ${stringify(res)} when res.queueId is not found.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Surface clear policy errors for 7702 transactions, improving transparency when transactions are blocked.
  • Bug Fixes
    • Prevent undefined transaction IDs by validating transaction responses for 7702 flows.
    • Improve reliability of transaction status reporting with stricter runtime checks.
  • Chores
    • Added release metadata for a patch update to reflect these improvements.

Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Building Building Preview Comment Sep 19, 2025 8:46am
nebula Ready Ready Preview Comment Sep 19, 2025 8:46am
thirdweb_playground Ready Ready Preview Comment Sep 19, 2025 8:46am
thirdweb-www Ready Ready Preview Comment Sep 19, 2025 8:46am
wallet-ui Ready Ready Preview Comment Sep 19, 2025 8:46am

Copy link

changeset-bot bot commented Sep 19, 2025

🦋 Changeset detected

Latest commit: 7bcd42e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Adds a changeset declaring a patch for the "thirdweb" package and updates executeWithSignature in the bundler to throw an error when a 7702 transaction response lacks a queueId, otherwise returning transactionId from res.queueId.

Changes

Cohort / File(s) Change Summary
Release metadata
\.changeset/smart-mugs-doubt.md
Added patch changeset for "thirdweb" with note: show policy error for 7702 transactions; no code changes.
7702 bundler guard
packages/thirdweb/src/wallets/smart/lib/bundler.ts
In executeWithSignature, added runtime guard: if res.queueId is falsy, throw "Error executing 7702 transaction: {res}". On success, return transactionId: res.queueId. No API signature changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Caller
  participant E as executeWithSignature
  participant B as Bundler API

  C->>E: executeWithSignature(request, signature)
  E->>B: POST 7702 tx payload
  B-->>E: res (may contain queueId)

  alt queueId present
    E-->>C: { transactionId: res.queueId }
  else queueId missing
    Note over E: Throw error<br/>"Error executing 7702 transaction: {res}"
    E-->>C: Error
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description contains the repository template comment and a PR-Codex overview that summarizes the code change, but it does not populate the required template sections: the formatted PR title/issue tag, "Notes for the reviewer," and "How to test" are missing or left as the commented template. There are no concrete test steps or reviewer guidance (for example commands, playground steps, or expected behavior) as required by the template. Please populate the template fields: add the formatted title or Linear issue tag, provide a "Notes for the reviewer" section explaining intent and edge cases, and include a "How to test" section with concrete reproduction steps and expected outcomes (e.g., a sample 7702 request and the expected error behavior), plus any unit or integration test commands. This will make the PR easier to review and verify.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "[SDK] Show policy error for 7702 transactions" accurately and concisely describes the primary change in this PR: adding an explicit error when a 7702 transaction response lacks a queueId in packages/thirdweb/src/wallets/smart/lib/bundler.ts. It is specific to the SDK scope and informative for teammates scanning history.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _SDK_Show_policy_error_for_7702_transactions

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

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

@joaquim-verges joaquim-verges marked this pull request as ready for review September 19, 2025 08:36
@joaquim-verges joaquim-verges requested review from a team as code owners September 19, 2025 08:36
@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Sep 19, 2025
Copy link
Member Author

joaquim-verges commented Sep 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)

365-365: Optional: cap serialized response in error

Long responses can bloat error surfaces/logs. Consider truncating the stringified payload (e.g., first 2k chars) or logging to debug only.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1d90437 and 7bcd42e.

📒 Files selected for processing (2)
  • .changeset/smart-mugs-doubt.md (1 hunks)
  • packages/thirdweb/src/wallets/smart/lib/bundler.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

.changeset/*.md: Each change in packages/* must include a changeset for the appropriate package
Version bump rules: patch for non‑API changes; minor for new/modified public API

Files:

  • .changeset/smart-mugs-doubt.md
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • packages/thirdweb/src/wallets/smart/lib/bundler.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • packages/thirdweb/src/wallets/smart/lib/bundler.ts
packages/thirdweb/src/wallets/**

📄 CodeRabbit inference engine (CLAUDE.md)

packages/thirdweb/src/wallets/**: Unified Wallet and Account interfaces in wallet architecture
Support for in-app wallets (social/email login)
Smart wallets with account abstraction
EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules

Files:

  • packages/thirdweb/src/wallets/smart/lib/bundler.ts
packages/thirdweb/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

packages/thirdweb/**/*.{ts,tsx}: Every public symbol must have comprehensive TSDoc with at least one compiling @example and a custom tag (@beta, @internal, @experimental, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
Lazy‑load heavy dependencies inside async paths (e.g., const { jsPDF } = await import("jspdf"))

Files:

  • packages/thirdweb/src/wallets/smart/lib/bundler.ts
🧠 Learnings (1)
📚 Learning: 2025-08-29T15:37:38.513Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: AGENTS.md:0-0
Timestamp: 2025-08-29T15:37:38.513Z
Learning: Applies to .changeset/*.md : Version bump rules: patch for non‑API changes; minor for new/modified public API

Applied to files:

  • .changeset/smart-mugs-doubt.md
🧬 Code graph analysis (1)
packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)
packages/thirdweb/src/exports/utils.ts (1)
  • stringify (189-189)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: Unit Tests
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Build Packages
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
.changeset/smart-mugs-doubt.md (1)

2-5: Correct bumps: patch for non‑API behavior change

Changeset looks good and follows the versioning rule for non‑API changes.

packages/thirdweb/src/wallets/smart/lib/bundler.ts (1)

364-366: Null‑safe guard before accessing res.queueId (packages/thirdweb/src/wallets/smart/lib/bundler.ts:364–366)

Change the check to validate res exists and queueId is a non-empty string:

-  if (!res.queueId) {
-    throw new Error(`Error executing 7702 transaction: ${stringify(res)}`);
-  }
+  if (!res || typeof res.queueId !== "string" || !res.queueId) {
+    throw new Error(`Error executing 7702 transaction: ${stringify(res)}`);
+  }
  • Repo scan shows many other queueId consumers (engine provider, UI); normalize sendBundlerRequest response shape or add equivalent guards where queueId is consumed.

Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 199 ms (+48.87% 🔺) 1.5 s
thirdweb (cjs) 361.44 KB (0%) 7.3 s (0%) 1.2 s (+3.63% 🔺) 8.5 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 50 ms (+845.52% 🔺) 164 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 34 ms (+872.2% 🔺) 44 ms
thirdweb/react (minimal + tree-shaking) 19.14 KB (0%) 383 ms (0%) 57 ms (+679.91% 🔺) 440 ms

Copy link

codecov bot commented Sep 19, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.34%. Comparing base (1d90437) to head (7bcd42e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/thirdweb/src/wallets/smart/lib/bundler.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8077      +/-   ##
==========================================
- Coverage   56.34%   56.34%   -0.01%     
==========================================
  Files         906      906              
  Lines       59168    59171       +3     
  Branches     4176     4173       -3     
==========================================
+ Hits        33341    33342       +1     
- Misses      25721    25723       +2     
  Partials      106      106              
Flag Coverage Δ
packages 56.34% <0.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
packages/thirdweb/src/wallets/smart/lib/bundler.ts 74.23% <0.00%> (-0.87%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@joaquim-verges joaquim-verges merged commit 7b8ceeb into main Sep 19, 2025
25 of 27 checks passed
@joaquim-verges joaquim-verges deleted the _SDK_Show_policy_error_for_7702_transactions branch September 19, 2025 08:53
@joaquim-verges joaquim-verges mentioned this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages SDK Involves changes to the thirdweb SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant