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

A participant's answer is silently lost when their connection drops

Đang mở Phù hợp với người mới
#175 1 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
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
frontend, networking

Hướng nghiên cứu

Bắt đầu với apps/frontend/src/screens/LiveQuiz.tsx, đặc biệt là handleAnswer, handleStart, handleNext và logic disabled của các nút trả lời. Hãy kiểm tra trạng thái ready của WebSocket trước khi cập nhật trạng thái câu trả lời đã chọn hoặc gửi câu trả lời, đồng thời để người tham gia và host nhìn thấy lỗi; issue vẫn để ngỏ lựa chọn giữa việc từ chối và đưa các câu chưa được trả lời vào hàng đợi. Hãy xác minh rằng kết nối thất bại không thể hiển thị câu trả lời như đã được gửi và các nút điều khiển của host cũng hiển thị lỗi tương tự.

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

Mô tả

bug help wanted UI & UX

In apps/frontend/src/screens/LiveQuiz.tsx, the answer buttons are disabled only by whether an answer is already chosen:

// line ~739
disabled={Boolean(selectedAnswer) || showResults}

They are never disabled by connectionState. handleAnswer then sends with an optional chain:

// line ~414
setSelectedAnswer(answerId);            // the UI locks in immediately
const timeMs = Date.now() - questionStartTime;
ws?.send(JSON.stringify({ ... }))       // no-ops silently on a dead socket

So after the reconnect attempts are exhausted (connectionState === "failed", the red banner showing), tapping an answer still works: selectedAnswer is set, the button renders as chosen, and nothing is sent. No throw, no error.

Why it matters

The player sees their answer highlighted as submitted and waits for results. It never reached the server, so they score 0 for that question — and for every question after, since the socket is still dead. The only clue is a banner they have most likely stopped noticing.

In a graded quiz this silently destroys someone's score.

handleStart and handleNext have the same unguarded ws?.send, so a host pressing Start or Next on a failed connection also gets no feedback.

What a fix looks like
  • Disable the answer buttons when connectionState !== "connected", with a visible reason rather than just the banner.
  • Make the send path explicit about failure: check ws?.readyState === WebSocket.OPEN before sending, and surface something to the user when it is not.
  • Decide what should happen to an answer chosen while disconnected — queue it for the reconnect, or refuse the tap outright. Say which you chose in the PR.
Definition of done
  • An answer cannot be visually "submitted" when it could not be sent
  • The participant is told their connection is the problem, at the moment they try
  • Host controls behave the same way
Ngôn ngữ chính
TypeScript
Star
21
Fork
7
Merge trung bình
3 giờ 39 phút
Pull request đã merge (30 ngày)
16

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 TheCodeHeist-Coder/Rexial

Tất cả issue của TheCodeHeist-Coder/Rexial

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.