Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Treat a stream that ends without [DONE] as an error

Chiusa Adatta ai principianti
#182 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, testing

Direzione di ricerca

Inizia in packages/widget/src/api/client.ts, nel ciclo di lettura e nel suo risultato attuale { done: true }, poi esamina packages/widget/tests/api/client.test.ts e l’helper mockChatStream in tests/helpers/stream.ts. Aggiungi test per gli stream che terminano con e senza [DONE]; done sembra indicare che il caso completato continua ad avere esito positivo, uno stream incompleto restituisce { error: 'network' } e la gestione dei timeout rimane intatta. Aggiungi il changeset patch richiesto per @chatcops/widget.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug good first issue hacktoberfest widget

All three server adapters end a reply with data: [DONE]. The widget's client treats the end of the stream as success either way: after the read loop it yields { done: true } (packages/widget/src/api/client.ts, lines 129 and 130). When a proxy or the server cuts the connection mid-reply, the visitor gets a half answer with no error and no Retry button.

What to do

  • If the stream ends without a [DONE] line, yield { error: 'network' } instead of { done: true }.
  • A [DONE] that arrives keeps working as today, and so does the timeout handling.

Acceptance criteria

  • Tests in packages/widget/tests/api/client.test.ts (the mockChatStream helper in tests/helpers/stream.ts builds the fake stream): ending with [DONE] gives done, ending without it gives error: 'network'
  • Changeset for @chatcops/widget (patch)
  • pnpm -r build, pnpm test and pnpm -r typecheck pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

Lingua principale
TypeScript
Stelle
13
Fork
7
Merge medio
3h 33m
PR unite (30g)
176

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codercops/chatcops

Tutte le issue di codercops/chatcops

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.