Conversation
Bumps the npm_and_yarn group with 1 update in the / directory: [express](https://github.com/expressjs/express). Updates `express` from 4.18.2 to 4.19.2 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](expressjs/express@4.18.2...4.19.2) --- updated-dependencies: - dependency-name: express dependency-type: direct:development dependency-group: npm_and_yarn-security-group ... Signed-off-by: dependabot[bot] <support@github.com>
[skip ci]
…ity-group-e0cd778f82
…yarn-security-group-e0cd778f82 Bump the npm_and_yarn group across 1 directory with 1 update
Snyk has created this PR to upgrade @tanstack/react-query from 5.45.1 to 5.64.2. See this package in npm: @tanstack/react-query See this project in Snyk: https://app.snyk.io/org/dargon789/project/bb845543-cbee-4e11-8cf9-8bfdf9205bf1?utm_source=github&utm_medium=referral&page=upgrade-pr
…9e16dcb9a2eda9 Snyk upgrade 03178c54d4c54014129e16dcb9a2eda9
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Bumps the npm_and_yarn group with 1 update in the / directory: [next](https://github.com/vercel/next.js). Updates `next` from 15.4.2 to 15.4.7 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](vercel/next.js@v15.4.2...v15.4.7) --- updated-dependencies: - dependency-name: next dependency-version: 15.4.7 dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Bumps the npm_and_yarn group with 1 update in the / directory: [happy-dom](https://github.com/capricorn86/happy-dom). Bumps the npm_and_yarn group with 1 update in the /packages/wallet/dapp-client directory: [happy-dom](https://github.com/capricorn86/happy-dom). Bumps the npm_and_yarn group with 1 update in the /packages/wallet/wdk directory: [happy-dom](https://github.com/capricorn86/happy-dom). Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](capricorn86/happy-dom@v17.6.3...v20.0.0) Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](capricorn86/happy-dom@v17.6.3...v20.0.0) Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](capricorn86/happy-dom@v17.6.3...v20.0.0) --- updated-dependencies: - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps the npm_and_yarn group with 1 update in the / directory: [happy-dom](https://github.com/capricorn86/happy-dom). Updates `happy-dom` from 20.0.0 to 20.0.2 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](capricorn86/happy-dom@v20.0.0...v20.0.2) --- updated-dependencies: - dependency-name: happy-dom dependency-version: 20.0.2 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Reviewer's GuideEnhances security and infrastructure by improving randomness and nonce generation, hardening error responses, updating CI workflows (GitHub Actions, CircleCI, Azure Pipelines, Fortify), adding issue templates and security policy, and introducing a new wagmi-based demo dapp project. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Hey - I've found 5 issues, and left some high level feedback:
- The new generateId implementation in DappTransport assumes a browser environment (
window.crypto), which will break in non-browser contexts (e.g. Node, React Native); consider usingglobalThis.cryptowith a feature check and a safe fallback to keep this transport reusable. - In the new wagmi-project App component,
sanitizeEmailis typed to accept astringbut is called withemailwhich can benull, and theonChangehandler usesSetStateAction<string>even though the state isstring | null; tightening these types or adding null guards will avoid runtime issues and TypeScript errors. - The Azure DevOps pipeline is pinned to Node.js 10.x, which is long out of support and inconsistent with the rest of the tooling (e.g. Vite/TypeScript), so it would be safer to upgrade this to a maintained Node version that matches the project’s current runtime expectations.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new generateId implementation in DappTransport assumes a browser environment (`window.crypto`), which will break in non-browser contexts (e.g. Node, React Native); consider using `globalThis.crypto` with a feature check and a safe fallback to keep this transport reusable.
- In the new wagmi-project App component, `sanitizeEmail` is typed to accept a `string` but is called with `email` which can be `null`, and the `onChange` handler uses `SetStateAction<string>` even though the state is `string | null`; tightening these types or adding null guards will avoid runtime issues and TypeScript errors.
- The Azure DevOps pipeline is pinned to Node.js 10.x, which is long out of support and inconsistent with the rest of the tooling (e.g. Vite/TypeScript), so it would be safer to upgrade this to a maintained Node version that matches the project’s current runtime expectations.
## Individual Comments
### Comment 1
<location path="wagmi-project/src/App.tsx" line_range="975-984" />
<code_context>
+ }
+ }, [email, isOpen])
+
+ const sanitizeEmail = (email: string) => {
+ // Trim unnecessary spaces
+ email = email.trim()
+
+ // Check if the email matches the pattern of a typical email
+ const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/
+ if (emailRegex.test(email)) {
+ return true
+ }
+
+ return false
+ }
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Fix type mismatch when calling `sanitizeEmail` with `email` that can be `null`.
Here `email` is typed as `null | string` in state, but `sanitizeEmail` only accepts `string`. When you call `sanitizeEmail(email)`, `email` may still be `null`, which will fail type-checking. Either widen `sanitizeEmail` to accept `string | null` and guard against `null` inside, or narrow `email` before the call so it’s guaranteed to be non-null.
</issue_to_address>
### Comment 2
<location path="wagmi-project/src/App.tsx" line_range="115-124" />
<code_context>
+ .sort((a, b) => a.chainId - b.chainId)
+ const networks = [...mainnets, ...testnets].filter(network => !network.deprecated && !omitNetworks.includes(network.chainId))
+
+ useEffect(() => {
+ if (email && !isOpen) {
+ console.log(email)
+ connect({
+ app: 'Demo Dapp',
+ authorize: true,
+ settings: {
+ // Specify signInWithEmail with an email address to allow user automatically sign in with the email option.
+ signInWithEmail: email,
+ theme: 'dark',
+ bannerUrl: `${window.location.origin}${skyweaverBannerUrl}`
+ }
+ })
+ setEmail(null)
+ }
+ }, [email, isOpen])
+
+ const sanitizeEmail = (email: string) => {
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Stabilize `connect` or include it in the dependency list to avoid stale closures.
Because `connect` is defined inline in the component, it’s recreated on every render, but it’s not in the effect’s dependency array. This can cause stale captures of `defaultConnectOptions` or other values used by `connect`, and may also violate eslint rules. Consider wrapping `connect` in `useCallback` and adding it to the dependencies, or document the intentional behavior and add a targeted eslint disable.
</issue_to_address>
### Comment 3
<location path="SECURITY.md" line_range="19" />
<code_context>
+
+Use this section to tell people how to report a vulnerability.
+
+Tell them to email [your-security-email@example.com], and they can expect an initial response within 48 hours. We will provide regular updates on the status of the reported vulnerability.
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Replace the placeholder security email with a real contact address.
`[your-security-email@example.com]` is still the template placeholder. Please update this to the real security contact so users know where to report vulnerabilities.
Suggested implementation:
```
Tell them to email [security@project-name.org](mailto:security@project-name.org), and they can expect an initial response within 48 hours. We will provide regular updates on the status of the reported vulnerability.
```
Replace `security@project-name.org` with the actual security contact address for your project (for example, `security@yourcompany.com` or `security@yourproject.org`) to ensure users can reach the correct team.
</issue_to_address>
### Comment 4
<location path=".github/ISSUE_TEMPLATE/bug_report.md" line_range="34" />
<code_context>
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Browser [e.g. stock browser, safari]
+ - Version [e.g. 22]
+
</code_context>
<issue_to_address>
**nitpick (typo):** Capitalize Safari in the smartphone browser example.
Also capitalize `Safari` here to match the product name.
Suggested implementation:
```
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. Chrome, Safari]
- Version [e.g. 22]
```
```
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, Safari]
```
</issue_to_address>
### Comment 5
<location path="wagmi-project/src/App.tsx" line_range="291" />
<code_context>
+ setConsoleLoading(false)
+ }
+
+ const getChainID = async () => {
+ try {
+ resetConsole()
</code_context>
<issue_to_address>
**issue (complexity):** Consider extracting shared helpers for console handling and wallet access so each async handler focuses only on its core logic instead of repeating boilerplate.
You can reduce a lot of incidental complexity here by centralizing the repeated console + wallet patterns, without changing any behavior.
### 1. DRY up the console pattern
Almost every async handler does:
```ts
try {
resetConsole()
// ...
setConsoleLoading(false)
} catch (e) {
console.error(e)
consoleErrorMessage()
}
```
Extracting a small helper keeps each handler focused on its core logic and removes the risk of forgetting `setConsoleLoading(false)`:
```ts
// inside App (or extracted to a hook/module)
const withConsole = async (fn: () => Promise<void>) => {
resetConsole()
try {
await fn()
} catch (e) {
console.error(e)
consoleErrorMessage()
} finally {
setConsoleLoading(false)
}
}
```
Then handlers become:
```ts
const getBalance = () =>
withConsole(async () => {
const wallet = sequence.getWallet()
const provider = wallet.getProvider()
const account = wallet.getAddress()
const balanceChk1 = await provider!.getBalance(account)
appendConsoleLine(`balance check 1: ${balanceChk1.toString()}`)
const signer = wallet.getSigner()
const balanceChk2 = await signer.getBalance()
appendConsoleLine(`balance check 2: ${balanceChk2.toString()}`)
})
```
You can apply this pattern to `getChainID`, `getAccounts`, `getNetworks`, `signMessage*`, `sendETH*`, `contractExample`, etc.
### 2. Centralize wallet access
You repeatedly recompute `const wallet = sequence.getWallet()` and then `wallet.getSigner()` / `wallet.getProvider()` in many places. A small helper makes the intent clearer and keeps the wiring in one place:
```ts
// inside App or a small helper module
const getWalletContext = () => {
const wallet = sequence.getWallet()
const provider = wallet.getProvider()
const signer = wallet.getSigner()
const address = wallet.getAddress()
const chainId = wallet.getChainId()
return { wallet, provider, signer, address, chainId }
}
```
Usage:
```ts
const getAccounts = () =>
withConsole(async () => {
const { wallet, provider, address } = getWalletContext()
appendConsoleLine(`getAddress(): ${address}`)
const accountList = await provider.listAccounts()
appendConsoleLine(`accounts: ${JSON.stringify(accountList)}`)
})
```
For cases where you need a signer for a specific chain:
```ts
const getSignerForChain = (chainId?: number) => {
const wallet = sequence.getWallet()
return chainId ? wallet.getSigner(chainId) : wallet.getSigner()
}
```
Then:
```ts
const sendETHSidechain = () =>
withConsole(async () => {
const wallet = sequence.getWallet()
const pick = wallet.getChainId() === ChainId.ARBITRUM ? ChainId.OPTIMISM : ChainId.ARBITRUM
const signer = getSignerForChain(pick)
await sendETH(signer)
})
```
This keeps all the “how do I get wallet/signer/provider” logic in one place and makes individual handlers smaller and easier to scan.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Wagmi-based React project, configures CI/CD pipelines (CircleCI and Azure), and implements security and randomness improvements across several packages. Key feedback highlights critical runtime issues in the new React application, including a type error from misusing the Sequence provider as a wallet instance and a potential crash in sanitizeEmail due to a missing null check. Additionally, the Azure pipeline should be updated to use a modern Node.js version and pnpm to match the project's package manager, direct window.crypto access should be guarded for SSR compatibility, dependencies in package.json should be pinned instead of using latest, and local V8 compile cache files should be removed from the repository.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary by Sourcery
Introduce a new wagmi-based demo dapp project and tighten security, tooling, and CI across the repository.
New Features:
wagmi-projectReact dapp configured with wagmi, WalletConnect, and basic styling and documentation.Bug Fixes:
Enhancements:
pnpm-format-labelGitHub workflow to the minimal required scope.Build:
pnpm install --no-frozen-lockfilestep to the tests GitHub workflow.CI:
Deployment:
Documentation:
Chores: