BUG: Flaky Network Switching Validation

Open
#57 0 comments 0 reactions 0 assignees View on GitHub

@Muneerali199 is already working on this.

Since Nov 15, 2026.

  • #112 by @Muneerali199 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, react

Research direction

Start by reading TransactionReview.jsx, especially handleBuySc and its network switch flow. Reproduce the mismatch by switching MetaMask to a different network and submitting a transaction; trace how the provider chain ID and freshWalletClient.chain.id are checked. Done when a successful network switch lets the transaction proceed immediately without a false mismatch error.

Written by the indexing model from the issue text.

Description

[y] I have checked for duplicate issues

Description
In TransactionReview.jsx, the handleBuySc function performs a manual verification of the network after switching. It compares window.ethereum chain ID with the freshWalletClient.chain.id. This logic is brittle because freshWalletClient might maintain an old reference or the provider might not have emitted the event yet, leading to false positives for "Network mismatch" errors.

How to Reproduce

  1. Set MetaMask to a network different from the one selected in the widget.
  2. Click "Send Transaction".
  3. Approve the network switch in MetaMask.

Expected Behavior
The transaction proceeds immediately after the switch.

Actual Behavior
Occasionally, the code throws Wallet client chain mismatch, forcing the user to click the button again.

[y] I want to work on this issue

Dominant language
JavaScript
Stars
16
Forks
29
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/StablePay

All issues in StabilityNexus/StablePay

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.