`getInvoice` never detects "not found": unknown invoice ids show a raw host error

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

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

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

評価

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

調査の方向性

web/lib/contract.ts から始めます。ここで getInvoice は message.includes("InvoiceNotFound") をチェックしています。名前の一致を維持したまま Error(Contract, #3) の検出を追加し、どちらの場合も null を返してください。web/app/pay/[id]/page.tsx を確認し、null の結果で「存在しません」というメッセージが表示されることを確かめてください。/pay/999999 でそのメッセージが表示され、getAllInvoices が変更されず、有効な ID が引き続き読み込まれれば完了です。

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

説明

bug difficulty: beginner good first issue help wanted web

Difficulty: Beginner

Problem

getInvoice checks message.includes("InvoiceNotFound"). Verified against the live testnet contract, the simulation error for an unknown id is HostError: Error(Contract, #3), so the check never matches. /pay/<unknown id> therefore shows the raw host error instead of "Invoice doesn't exist".

Why it matters

Opening a wrong or mistyped payment link is the most common client mistake, and it currently gets the worst message.

Scope of work

Detect Error(Contract, #3) (keep the name match too) and return null; add a unit test if a test runner is available (see #13).

Acceptance criteria

  • /pay/999999 shows the "doesn't exist" message.
  • getAllInvoices behaves as before.
  • Valid ids are unaffected.

Relevant files

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

Dependencies

Overlaps in spirit with #12 (error mapping), but this fix stands alone.

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 を短くまとめたダイジェスト。