Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đã đóng Phù hợp với người mới
#182 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
frontend, testing

Hướng nghiên cứu

Bắt đầu tại packages/widget/src/api/client.ts, ở vòng lặp đọc và kết quả hiện tại { done: true }, sau đó xem lại packages/widget/tests/api/client.test.ts và helper mockChatStream trong tests/helpers/stream.ts. Bổ sung kiểm thử cho các stream kết thúc có và không có [DONE]; done có vẻ cho biết trường hợp hoàn tất vẫn thành công, stream chưa hoàn tất trả về { error: 'network' } và xử lý timeout vẫn hoạt động bình thường. Thêm changeset patch được yêu cầu cho @chatcops/widget.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
13
Fork
7
Merge trung bình
3 giờ 41 phút
Pull request đã merge (30 ngày)
155

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codercops/chatcops

Tất cả issue của codercops/chatcops

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.