bug(api): _doConnect swallows connection/auth errors and marks failed sessions as authenticated
Maintainer thường phản hồi trong vòng 1 ngà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
- 76/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ệ
- javascript, react
- Lĩnh vực
- authentication, backend-api-design
Hướng nghiên cứu
Đọc packages/api/src/EmbeddedChatApi.ts và packages/react/src/views/EmbeddedChat.js để theo dõi cách lỗi kết nối được truyền đến trạng thái xác thực. Kiểm tra luồng kết nối để tìm lỗi từ kết nối, đăng nhập và các đăng ký stream, sau đó chạy các bài kiểm thử liên quan hoặc bổ sung kiểm thử cho các kết nối bị từ chối. Hoàn thành khi các kết nối thất bại bị từ chối và không đánh dấu người dùng là đã xác thực.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description:
In packages/api/src/EmbeddedChatApi.ts, _doConnect() catches errors from this.sdk.connection.connect(), this.sdk.account.loginWithToken(), and stream subscriptions, calls this.close(), and never rethrows the error.
Because _doConnect() resolves with undefined instead of rejecting, RCInstance.connect(isChannelPrivate).then(...) in packages/react/src/views/EmbeddedChat.js still executes and sets isUserAuthenticated(true) even though the DDP connection failed and was closed.
Steps to reproduce:
- Instantiate
EmbeddedChatApiand triggerapi.connect()whilesdk.connection.connect()orsdk.account.loginWithToken()fails/rejects. - Observe that
api.connect()resolves normally instead of rejecting. - In
EmbeddedChat.js,.then()runs and marksisUserAuthenticatedastruewith no active DDP subscriptions.
Expected behavior:
_doConnect() should clean up via await this.close() and rethrow the error so connect() rejects and EmbeddedChat does not mark a failed connection as authenticated.
Actual behavior:
connect() resolves silently and EmbeddedChat logs "Connected to RocketChat ..." and sets isUserAuthenticated(true) on a closed socket.
- Ngôn ngữ chính
- JavaScript
- Star
- 171
- Fork
- 421
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không 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 RocketChat/EmbeddedChat
-
Bug: username fallback in updateUserUsername never runs since the ddp-client migrationCó thể đã có người làm @MuhammadFaizan-prog đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
RocketChat/EmbeddedChat#1489 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Low contrast on color swatch borders in Theme Lab (Layout Editor)Có thể đã có người làm @yashsarvaiya45 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
RocketChat/EmbeddedChat#1486 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: White screen crash (`Cannot read properties of undefined (reading 'members')`) when rendering UserMention outside MarkupInteractionContextCó thể đã có người làm @swarnendusahu10-dotcom đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
RocketChat/EmbeddedChat#1482 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: UIKit PreviewBlock cover image tiles repeatedly and stretches across viewport when zoomed outCó thể đã có người làm @swarnendusahu10-dotcom đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
RocketChat/EmbeddedChat#1480 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ug(react): guard against null childElement in MessageAggregator setJumpToMessageCó thể đã có người làm @Suraj704-glitch đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
RocketChat/EmbeddedChat#1478 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của RocketChat/EmbeddedChat
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
[Docs] CONTRIBUTING.md links to retired GitHub Learning Lab and Try Git sitesCó thể đã có người làm @adityamukesh đã 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 85/100
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
reillywalter/win-dev-doctor#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature] 新增「查看完整听歌设备记录」接口Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100