Test the live updates stream (/api/events)
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 86/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Read the /api/events route in server/server.js and the existing tests and Client class in tests/api.test.mjs. Add coverage for unauthenticated access, the initial change event and revision, updates after a write, and the proposals event. Run npm test; cancel the stream reader so the test process exits.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The task
When someone changes the map, the others see it live: the browser keeps GET /api/events open, a Server-Sent Events stream, and the server pushes an event on every change. Nothing tests this stream. Add a test, so that a change to the server cannot silently stop live updates.
Where to look
server/server.js: the/api/eventsroute (around line 359) sendsevent: changewith the currentrevas soon as it opens;commitChanges()then broadcastschangewith the newrevafter every write, andsaveProposals()broadcastsproposalstests/api.test.mjs: the existing tests and theClientclass.fetchcan read a stream: readres.bodywith a reader and split the text on blank lines (\n\n), each block is one event
Close the stream at the end of the test (cancel the reader), or the test run will not exit.
Done when
- Opening
/api/eventswithout credentials gets401 - With credentials, the first event is
changewith the currentrev - After a write (
PUT /api/si/...as an approver), achangeevent arrives withrev + 1 - Creating a proposal sends a
proposalsevent -
npm testpasses, and exits on its own
Mentor
@0b3l1X-SolidGeeks
- Ngôn ngữ chính
- JavaScript
- Star
- 0
- Fork
- 1
- Merge trung bình
- 2 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không 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 SolidGeeks/strata
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SolidGeeks/strata#21 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
SolidGeeks/strata#4 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 22/100
SolidGeeks/strata#22 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
SolidGeeks/strata#20 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
SolidGeeks/strata#19 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SolidGeeks/strata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
flarum/framework#5301 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
AOSSIE-Org/BabyNest#284 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status:untriaged
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
midnightntwrk/servicedesk#275 ·
Maintainer thường phản hồi trong vòng 1 ngày