Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Test the live updates stream (/api/events)

未关闭 适合新手
#16 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
领域
backend, testing

调研方向

阅读 apps/api/src/routes.ts,查看 broadcast() 和 /api/events 路由,然后检查 Client 类以及 tests/api.test.mjs 中现有的 API 测试模式。添加对未认证访问、incident 更新和 playbook 保存的测试覆盖。使用 reader 读取每个流并取消它,以便 npm test 退出。验证预期的事件类型和 incident id,并且 npm test 通过后,即为完成。

由索引模型根据 Issue 内容生成。

描述

good first issue help wanted
The task

When someone changes a playbook or an incident, everyone sees 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
  • apps/api/src/routes.ts: broadcast() near the top writes event: change with { type, id } as data; the /api/events route needs a signed-in user (role viewer)
  • tests/api.test.mjs: the Client class keeps the session cookie. fetch can read a stream: read res.body with a reader and split the text on blank lines (\n\n), each block is one event

Cancel the reader at the end of the test, or the test run will not exit.

Done when
  • Opening /api/events without a session gets 401
  • With a session, after an analyst changes an incident (for example its name, POST /api/incidents/:id/meta), an event: change arrives with type incident and the incident's id
  • After an editor saves a playbook draft, an event arrives with type playbook
  • npm test passes, and exits on its own
Mentor

@0b3l1X-SolidGeeks

主要语言
TypeScript
星标
0
派生
1
平均合并
9 分钟
30 天内合并 PR
10

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SolidGeeks/muster 的其他 Issue

查看 SolidGeeks/muster 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。