bug(client): RelayRateLimitError.retryAfter is negative when server sends Retry-After: -5

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

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

@ayushjava07 がすでに取り組んでいます。

2026年11月7日 から。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
api, backend

調査の方向性

数値の Retry-After の処理は src/client.ts:292-294 にあります。src/client.ts:298 のHTTP日付の処理と併せて読んでください。Retry-After: -5 を指定した429レスポンスを再現し、既存のクライアントテストにレート制限のテストがあるか確認してください。負の数値ヘッダーに対して RelayRateLimitError.retryAfter が0になれば完了です。

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

説明

bug
Bug Description

When the relay responds 429 Too Many Requests with a negative numeric
Retry-After header (e.g. Retry-After: -5), the client stores it as-is.
RelayRateLimitError.retryAfter becomes -5 — an impossible wait duration.

The HTTP-date path already clamps via Math.max(0, ...) (src/client.ts:298),
but the numeric path (src/client.ts:292-294) does not.

Steps to Reproduce
import { RelayClient } from "@aossie-org/thrubox-client";

const relay = new RelayClient("https://relay.example.org");
try {
  await relay.receive("0xWallet");
} catch (e) {
  // relay replies: 429 + "Retry-After: -5"
  console.log(e.retryAfter); // -5  ❌ (expected: 0)
}
9989f16" />

### Logs and Screenshots

<img width="1186" height="230" alt="Image" src="https://github.com/user-attachments/assets/c52040fd-8a4e-4364-ad52-4e7fc527c461" />github.com/user-attachments/assets/ca955346-7820-4e39-bcfd-e697f

### Environment Details
Package: @aossie-org/thrubox-client
Version: 1.1.0 (published on npm — confirmed the published dist/index.cjs contains this code)
Runtime: Node 18+, browsers

### Impact

Critical - Application is unusable

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates
主要言語
YAML
スター
2
フォーク
2
平均マージ
1日 1時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

AOSSIE-Org/ThruBox-Client のほかの issue

AOSSIE-Org/ThruBox-Client の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

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

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