Skip to content

fix: resolve 1 bugs in MicroAI-Paygate - #397

Closed
saurabhhhcodes wants to merge 1 commit into
AnkanMisra:mainfrom
saurabhhhcodes:fix/MicroAI-Paygate-98102
Closed

fix: resolve 1 bugs in MicroAI-Paygate#397
saurabhhhcodes wants to merge 1 commit into
AnkanMisra:mainfrom
saurabhhhcodes:fix/MicroAI-Paygate-98102

Conversation

@saurabhhhcodes

@saurabhhhcodes saurabhhhcodes commented Aug 4, 2026

Copy link
Copy Markdown

Description

This PR fixes real bugs found in the codebase:

  • Added rejection handler to Promise.all: an unhandled rejection in any input promise previously crashed silently.

Type of Change

  • Bug fix (non-breaking change fixing an issue)

How Has This Been Tested?

  • Local manual testing

Checklist

  • My code follows the style guidelines
  • I have performed a self-review

Related Issue

Ref: #396

Note

Catch unhandled promise rejections in wallet-widget.tsx

Adds a .catch handler to the Promise.all chain in wallet-widget.tsx so rejections are logged to console.error with the prefix "Promise.all failed:" instead of remaining unhandled.

Macroscope summarized 3ffa780.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of wallet operation failures by logging rejected requests for easier troubleshooting.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ankanmisra's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The wallet widget now logs failures when its Promise.all operation rejects.

Changes

Wallet error handling

Layer / File(s) Summary
Promise rejection handler
web/src/components/wallet-widget.tsx
Adds a rejection handler that logs Promise.all failures to the console.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

Suggested reviewers: ankanmisra

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies a bug fix in MicroAI-Paygate and relates to the pull request changes, although its grammar is incorrect.
Description check ✅ Passed The description explains the bug fix, testing method, checklist status, and related issue, but it omits several template sections and exact verification commands.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.6)
web/src/components/wallet-widget.tsx

File contains syntax errors that prevent linting: Line 263: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.


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.

@github-actions github-actions Bot added the TypeScript TypeScript code label Aug 4, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/wallet-widget.tsx`:
- Around line 262-263: Fix the Promise.all chain in the wallet widget by
attaching the catch handler directly to the Promise.all(...) expression before
the terminating semicolon. Preserve the existing error message and promise
arguments while ensuring the expression parses correctly.
- Around line 262-263: Add a Web regression test covering the Promise.all
rejection path associated with the catch handler in wallet-widget.tsx, using a
deliberately rejected input while awaiting or otherwise handling the resulting
promise so no unhandled rejection remains. Verify the test exercises the
“Promise.all failed” path, then run lint, typecheck, unit tests, and build from
the web workspace.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e09950d6-1dd8-4b70-a457-1d58dd2c7a42

📥 Commits

Reviewing files that changed from the base of the PR and between e8481a3 and 3ffa780.

📒 Files selected for processing (1)
  • web/src/components/wallet-widget.tsx

Comment on lines +262 to +263

.catch(err => console.error("Promise.all failed:", err)); No newline at end of file

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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Fix the Promise.all chaining syntax before merge.

As written, line 263 starts with .catch(...) as a separate statement. Biome reports this as a parse error. Attach .catch(...) directly to the Promise.all(...) expression before its terminating semicolon.

Promise.all(/* existing promises */)
  .catch(err => console.error("Promise.all failed:", err));
🧰 Tools
🪛 Biome (2.5.6)

[error] 263-263: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.

(parse)

🪛 GitHub Actions: Web Lint & Build / 0_web-lint-build.txt

[error] 263-263: ESLint parsing error: Declaration or statement expected. The 'bun run lint' command failed with exit code 1.

🪛 GitHub Actions: Web Lint & Build / web-lint-build

[error] 263-263: ESLint parsing error: Declaration or statement expected. The 'bun run lint' command failed with exit code 1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/wallet-widget.tsx` around lines 262 - 263, Fix the
Promise.all chain in the wallet widget by attaching the catch handler directly
to the Promise.all(...) expression before the terminating semicolon. Preserve
the existing error message and promise arguments while ensuring the expression
parses correctly.

Source: Linters/SAST tools


🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'WalletWidget|Promise\.all failed|Promise\.all' web --glob '*.{test,spec}.{ts,tsx}'

Repository: AnkanMisra/MicroAI-Paygate

Length of output: 164


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'WalletWidget|Promise\.all failed|Promise\.all' web --glob '*.{test,spec}.{ts,tsx}'

Repository: AnkanMisra/MicroAI-Paygate

Length of output: 164


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n 'WalletWidget|Promise\.all failed|Promise\.all' web --glob '*.{test,spec}.{ts,tsx}'

Repository: AnkanMisra/MicroAI-Paygate

Length of output: 164


Add a regression test for rejected inputs.

No current Web test covers one Promise.all input rejecting or the Promise.all failed handler running. Add a Web test that exercises the rejection path without leaving an unhandled rejection.

Then run bun run lint, bun run typecheck, bun run test:unit, and bun run build from web.

🧰 Tools
🪛 Biome (2.5.6)

[error] 263-263: Expected a statement but instead found '.catch(err => console.error("Promise.all failed:", err))'.

(parse)

🪛 GitHub Actions: Web Lint & Build / 0_web-lint-build.txt

[error] 263-263: ESLint parsing error: Declaration or statement expected. The 'bun run lint' command failed with exit code 1.

🪛 GitHub Actions: Web Lint & Build / web-lint-build

[error] 263-263: ESLint parsing error: Declaration or statement expected. The 'bun run lint' command failed with exit code 1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/wallet-widget.tsx` around lines 262 - 263, Add a Web
regression test covering the Promise.all rejection path associated with the
catch handler in wallet-widget.tsx, using a deliberately rejected input while
awaiting or otherwise handling the resulting promise so no unhandled rejection
remains. Verify the test exercises the “Promise.all failed” path, then run lint,
typecheck, unit tests, and build from the web workspace.

Source: Coding guidelines

@AnkanMisra AnkanMisra closed this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TypeScript TypeScript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants