[FEATURE]: Report when a Promise RPC event listener ends

オープン
#65,381 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

Start at packages/client/src/promise/rpc.ts:124-137, where the callback subscription is built and only an unsubscribe function is returned, then trace how the underlying events.subscribe stream signals completion and failure. Read the client subscription documentation linked in the issue to see the documented contract callers rely on. Done means the callback API can report normal completion or a handler error exactly once, treats explicit unsubscribe as cancellation, and keeps sequential handling and per-subscriber cancellation intact, with tests covering each case.

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

説明

area/sdk-api type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Please let callers observe when client.rpc(contract).events.on(...) stops listening. A status widget using this callback API needs to leave its live state after a server disconnect and let its owner decide when to resubscribe.

Currently it returns only an unsubscribe function. Callback/source failures are logged internally, and normal stream completion has no caller notification. The working alternative is to replace the callback subscription with a supervised events.subscribe(...) loop.

An optional lifecycle callback or completion-bearing subscription handle would make this possible without replacing the callback API:

  • Report normal completion or failure once, including errors thrown by an async handler.
  • Treat explicit unsubscribe/abort as cancellation rather than an unexpected error.
  • Preserve sequential callback handling and cancellation of only that subscriber.

Reconnection and resynchronization would remain caller-controlled. This is an enhancement to the documented behavior, not a report of a user incident. Source: packages/client/src/promise/rpc.ts:124-137; client subscription documentation.

主要言語
TypeScript
スター
227k
フォーク
30.7k
平均マージ
3時間 57分
マージ済み PR(30日)
484

環境構築

はじめの一歩

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

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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