`/pay/[id]` shows a cryptic error for non-numeric, negative or huge ids

オープン 初心者向け
#59 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

web/lib/contract.ts から始めてください。ここでは getInvoice が BigInt(id) を呼び出し、その後 RPC のパスに進みます。また web/app/pay/[id]/page.tsx も確認してください。こちらは検索結果を描画しています。id が最初にパースされる場所と、既存の not-found カードが表示される場所を見つけてください。/pay/abc、/pay/1.5、/pay/-1 と 2^64 - 1 を超える id が、RPC 呼び出しを一切行わずに not-found カードを表示し、有効な id は従来どおり動作すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug difficulty: beginner good first issue help wanted web

Difficulty: Beginner

Problem

getInvoice runs BigInt(id). A link such as /pay/abc or /pay/1.5 throws a SyntaxError that users see ("Cannot convert abc to a BigInt"), and -1 or ids above the u64 maximum fail inside nativeToScVal.

Why it matters

Shared links get mistyped. A clean "doesn't exist" page is the expected result.

Scope of work

Validate the id (^\d+$ and at most 2^64 - 1) before any RPC call and show the existing not-found card.

Acceptance criteria

  • Invalid ids render "Invoice doesn't exist" with no RPC call.
  • Valid ids are unchanged.

Relevant files

  • web/app/pay/[id]/page.tsx, web/lib/contract.ts

Dependencies

None.

Maintainer discussion needed?

No.

主要言語
TypeScript
スター
0
フォーク
4
平均マージ
54分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Yormee-103/PayLoop のほかの issue

Yormee-103/PayLoop の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。