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

Abierto
#65,381 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
227k
Forks
30.7k
Merge medio
3 h 57 min
PR fusionados (30 d)
484

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de anomalyco/opencode

Todos los issues de anomalyco/opencode

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.