Skip to content

fix: add safe connector to widget-cfg explicitly#7660

Merged
shoom3301 merged 2 commits into
developfrom
fix/7652
Jun 17, 2026
Merged

fix: add safe connector to widget-cfg explicitly#7660
shoom3301 merged 2 commits into
developfrom
fix/7652

Conversation

@shoom3301

@shoom3301 shoom3301 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #7652 (only the 1st case)

I figured out that it throws RpcError: undefined: "eth_requestAccounts" not implemented.
The error comes from SafeAppProvider on the Widget configurator side.
I just set the connector explicitly from @wagmi/connectors and now it works well.

To Test

See the 1st case of #7652

Summary by CodeRabbit

  • New Features
    • Added Safe wallet connector support, enabling users to connect their Safe wallets to the application.

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cowfi Ready Ready Preview Jun 17, 2026 9:36am
storybook Ready Ready Preview Jun 17, 2026 9:36am
widget-configurator Ready Ready Preview Jun 17, 2026 9:36am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
cosmos Ignored Ignored Jun 17, 2026 9:36am
sdk-tools Ignored Ignored Preview Jun 17, 2026 9:36am

Request Review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying explorer-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: a96f4ec
Status: ✅  Deploy successful!
Preview URL: https://265ee0bb.explorer-dev-dxz.pages.dev
Branch Preview URL: https://fix-7652.explorer-dev-dxz.pages.dev

View logs

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploying swap-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: a96f4ec
Status: ✅  Deploy successful!
Preview URL: https://ea69b7e0.swap-dev-5u6.pages.dev
Branch Preview URL: https://fix-7652.swap-dev-5u6.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4bfa9de0-8a0e-471e-8b03-858875daf899

📥 Commits

Reviewing files that changed from the base of the PR and between 821807f and a96f4ec.

📒 Files selected for processing (2)
  • apps/widget-configurator/src/wagmiConfig.ts
  • libs/wallet/src/wagmi/getConnectors.ts

Walkthrough

The safe connector from @wagmi/connectors is added as the first connector in the WagmiAdapter configuration in the widget-configurator with a 1000 ms info timeout. The import source for injected and safe in libs/wallet/src/wagmi/getConnectors.ts is updated from wagmi/connectors to @wagmi/connectors.

Safe wallet connector configuration

Layer / File(s) Summary
Safe connector import and registration
libs/wallet/src/wagmi/getConnectors.ts, apps/widget-configurator/src/wagmiConfig.ts
injected and safe imports are moved from wagmi/connectors to @wagmi/connectors in getConnectors.ts; safe({ unstable_getInfoTimeout: 1000 }) is prepended to the connectors array in WagmiAdapter.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • Danziger
  • kernelwhisperer

Poem

🐰 Hoppin' through the wallet gate,
Safe connector joins the slate!
First in line with timeout set,
Import path now squared and net.
No more broken iframe blues —
Safe wallet wins, that's the news! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: add safe connector to widget-cfg explicitly' clearly summarizes the main change of adding explicit Safe connector support to the widget configurator.
Description check ✅ Passed The PR description identifies the issue being fixed (#7652, case 1) and provides context about the RpcError and solution, though it lacks detailed testing steps and implementation details.
Linked Issues check ✅ Passed The PR addresses the first coding requirement from issue #7652: fixing the dapp mode Safe connection by explicitly configuring the Safe connector from @wagmi/connectors to resolve the RpcError.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the Safe connector configuration issue described in issue #7652. No out-of-scope modifications are 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.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/7652

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@shoom3301 shoom3301 self-assigned this Jun 17, 2026

@fairlighteth fairlighteth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI Review (Codex GPT-5, worked 4m): no new findings

Review completed. I found no new non-duplicate comments worth posting.

Review scope and related context

  • Checked the current PR head a96f4ec against develop.
  • Reviewed the Safe connector addition in apps/widget-configurator/src/wagmiConfig.ts and the connector import update in libs/wallet/src/wagmi/getConnectors.ts.
  • No existing review threads or human review comments were present to recheck.
  • CI context: Typecheck and Agent Harness passed; Lint, Test, and Cypress were still pending when reviewed.

Generated using the pr-review skill from the CoW Protocol skills repo.

@fairlighteth

Copy link
Copy Markdown
Contributor
Scoped browser QA passed: Safe dapp-mode connection verified

Outcome

  • Widget configurator loaded as a Safe app in dapp mode.
  • Safe SDK messages were handled and the configurator showed the Safe account button.
  • The embedded swap widget rendered, and the original eth_requestAccounts not implemented / RpcError state did not appear.
  • Scope: PR-described Widget dapp mode: connection issues in some cases #7652 case 1 in Chromium and Firefox with a local Safe parent harness.

Run details

  • Source: widget-configurator preview at a96f4ec
  • Browsers: Chromium 149.0.7827.55; Firefox 151.0
  • OS: macOS
  • Wallet: Safe fixture address 0x9C6FEA0B2eAc5b6D8bBB6C30401D42aA95398190; wallet-connected-ui reached in the configurator; signing-capable not exercised.
  • Browser QA was executed with Playwright; this was not a manual human QA pass.
  • Results were visually inspected from the recorded walkthroughs.
  • AI assistance: Codex GPT-5.

Artifacts

Chromium final state:
PR 7660 Chromium Safe dapp-mode final state

How to retest

  • Open the widget-configurator PR preview inside a Safe-app parent context.
  • Keep Dapp mode selected.
  • Expected: the configurator connects through Safe, shows the Safe account button, and the embedded widget renders without the eth_requestAccounts SafeAppProvider error.

Not checked in this pass

  • A real app.safe.global session.
  • Real-wallet signing or transaction submission.
  • Safari.
Note: preview iframe routing

Impact:

  • The tested PR surface was the widget-configurator preview.

Observed behavior:

  • The Vercel swap iframe host referenced by the configurator preview was missing.

Interpretation:

  • The run proxied that iframe host to the PR's Cloudflare fix-7652 swap preview while preserving the iframe origin expected by the configurator, so the embedded widget could render and the Safe provider handoff could be checked.

Generated using the pr-qa skill from the CoW Protocol skills repo.

@elena-zh elena-zh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you, works way better

@shoom3301 shoom3301 merged commit a5e72b6 into develop Jun 17, 2026
19 of 20 checks passed
@shoom3301 shoom3301 deleted the fix/7652 branch June 17, 2026 14:53
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widget dapp mode: connection issues in some cases

3 participants