Double response and logic error in account settings update
Maintainer thường phản hồi trong vòng 4 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
- 55/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- authentication, backend
Hướng nghiên cứu
Mở server/controllers/user.controller/authManagement.ts và kiểm tra updateSettings(), đặc biệt là các dòng 159–201 và các lệnh gọi saveUser(). Tái hiện các luồng thiết lập mật khẩu và cập nhật mật khẩu bằng social-login được mô tả trong issue. Hoàn tất khi mỗi request gửi chính xác một response mà không có lỗi headers-already-sent hoặc 401 không chính xác sau khi thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
p5.js version
No response
What is your operating system?
None
Web browser and version
No response
Actual Behavior
In updateSettings() multiple code paths send a response but do not return, so:
- Social login user setting password:
saveUser(res, user)is called (sends 200), then execution continues and can send 401. - Password update:
await saveUser(res, user)sends response, then execution falls through andsaveUser()is called again in theelseblock.
Result: "Cannot set headers after they are sent", inconsistent client state, or users seeing errors despite success.
Location: server/controllers/user.controller/authManagement.ts lines 159–201
Expected Behavior
Each code path that sends a response should return immediately. Only one response per request.
Steps to reproduce
- Log in with a social account (e.g. Google) that has no password set.
- Go to Account settings and set a new password (no current password).
- Submit the form. Observe: success response may be sent, then 401 or double-response error.
- Alternatively: log in with email/password, change password, submit. Observe possible double response or header errors.
Snippet:
// authManagement.ts - updateSettings (simplified)
if (user.password === undefined) {
user.password = req.body.newPassword;
saveUser(res, user); // sends response, no return
}
if (!req.body.currentPassword) {
res.status(401).json({ ... }); // second response
return;
}
// ...
await saveUser(res, user); // line 177 - sends response
// no return - falls through to:
} else {
await saveUser(res, user); // line 201 - sends again
}
- Ngôn ngữ chính
- JavaScript
- Star
- 1.7k
- Fork
- 1.7k
- Merge trung bình
- 8 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 14
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 processing/p5.js-web-editor
-
Unable to rename sound filesCó thể đã có người làm @prithq đã nhận 2 ngày trước. Đang mởAwaiting Maintainer Approval Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
processing/p5.js-web-editor#4392 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Renaming a folder doubles the folder name in file paths (console errors show /lib/lib/helper.js)Đang mởAwaiting Maintainer Approval Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
processing/p5.js-web-editor#4365 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
p5 logo is broken on verification emailsCó thể đã có người làm @sourabh65mehta đã nhận 17 ngày trước. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
processing/p5.js-web-editor#4364 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 4 ngày
-
`PATCH /editor/project/visibility` returns 200 with `null` and doesn't update when `projectId` is a slugCó thể làm lại được @Prbhtsgh đã nhận 25 ngày trước và không có pull request nào đang mở. Đang mởAwaiting Maintainer Approval Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
processing/p5.js-web-editor#4348 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Fix: example.js stores defaultHTML function reference instead of calling it, causing examples to display raw JavaScript source in previewCó thể đã có người làm @syedbarkath980 đã nhận 29 ngày trước. Đang mởBug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
processing/p5.js-web-editor#4344 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của processing/p5.js-web-editor
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
mongoosejs/mquery#142 ·
-
Site Suggestion: bullseyeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add toro4n to the data modeling toolsCó thể đã có người làm @henriklantzhedstrom-prog đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
neo4j/docs-getting-started#546 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 25 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
libnativeapi/nativeapi#21 ·