The join endpoint returns an error shape the frontend cannot read
Maintainer thường phản hồi trong vòng 1 ngày
@Anshuu2004 đang làm issue này rồi.
Từ ngày 24/10/2026.
Đá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
- 86/100
Hướng nghiên cứu
Đọc apps/http-server/src/controllers/sessionController.ts và helper dùng chung apps/http-server/src/utils/error.ts, sau đó tìm trong service các lời gọi trực tiếp res.status(...).json({ message }) ở các nhánh lỗi. Thay phản hồi của endpoint tham gia bằng helper dùng chung và kiểm tra màn hình tham gia có đọc thông báo từ server hay không. Hoàn tất khi mọi lỗi của http-server đều dùng { success: false, error: string } và không còn phản hồi lỗi thô theo định dạng message.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Every error in http-server goes through a shared helper:
// apps/http-server/src/utils/error.ts
export const errorResponse = (res: Response, statusCode: number, message: string) => {
return res.status(statusCode).json({ success: false, error: message })
}
One line does not:
// apps/http-server/src/controllers/sessionController.ts:15
if (!code || !username) {
return res.status(400).json({ message: "Code and username are required" });
}
Confirmed against the live API:
POST /api/v1/session/join {}
→ {"message":"Code and username are required"} # every other endpoint sends {success, error}
Why it matters
It is not only inconsistent — the message is silently dropped. The join screen reads .error:
// apps/frontend/src/screens/JoinQuiz.tsx
type JoinRequestError = { response?: { data?: { error?: string } } };
...
setError(joinError.response?.data?.error || "Failed to join quiz");
The server sends .message, so the fallback always wins and the user sees the generic "Failed to join quiz" instead of what actually went wrong.
The join screen validates client-side first, so today this mostly affects direct API calls and anything that bypasses the form — but it is a real swallowed message, and the inconsistency is a trap for the next person who adds an endpoint here.
What a fix looks like
return errorResponse(res, 400, "Code and username are required");
Then check the rest of the service for other raw res.json calls on error paths. The convention is well established — errorResponse is used 22 times in quizController, 9 in authController, 7 in inviteController, 5 elsewhere in sessionController — so anything else that does not use it is probably the same oversight.
Definition of done
- Every error response from
http-serverhas the shape{ success: false, error: string } - The join screen shows the server's message rather than its fallback
- No other raw
res.status(...).json({ message })remains on an error path
Good first issue: one line to fix, and a good way to learn a codebase convention by finding where it was not followed.
- Ngôn ngữ chính
- TypeScript
- Star
- 21
- Fork
- 7
- Merge trung bình
- 4 giờ 31 phút
- Pull request đã merge (30 ngày)
- 22
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TheCodeHeist-Coder/Rexial
-
bug good first issue help wanted UI & UX
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TheCodeHeist-Coder/Rexial#205 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
One PDF upload freezes the whole AI service, including its health checkCó thể đã có người làm @Anshuu2004 đã nhận 2 ngày trước. Đang mởBackend first issue bug help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
TheCodeHeist-Coder/Rexial#193 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Registering without a password returns a 500 instead of telling you what is missingCó thể đã có người làm @Anshuu2004 đã nhận 2 ngày trước. Đang mởBackend first issue bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
TheCodeHeist-Coder/Rexial#191 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
CI does not run the frontend testsCó thể đã có người làm @nayan45633 đã nhận 2 ngày trước. Đang mởBackend first issue good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
TheCodeHeist-Coder/Rexial#188 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
TheCodeHeist-Coder/Rexial#187 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TheCodeHeist-Coder/Rexial
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
outline/outline#14348 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Agent import retains quotes in .env API keys followed by inline commentsCó thể đã có người làm @yxr-2025 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
elie222/rakazo#2322 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
awslabs/visual-asset-management-system#804 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
用户目录有单引号时,热加载时YAML解析崩溃Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dsh-market/dsh-market#1027 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày