[Good first issue] 新建新闻提醒只检查创建后的新闻

Open Beginner friendly
#64 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bun, typescript
Domain
backend

Research direction

Start with evaluateRule in packages/shared/src/alerts/evaluators.ts (around lines 195-213), where the new_news branch picks its lower time bound, and check the createdAt and cursor fields in packages/core/src/alert-rules.ts. Run bun test packages/shared/src/alerts/evaluators.test.ts to see the existing offline cases and the mocked research.news setup. Done means a first evaluation counts only news published after createdAt, later evaluations keep using the saved cursor, and the three fixed-clock scenarios in the issue pass.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted

最小复现

用模拟 research.news 给同一标的返回两条新闻,一条早于规则的 createdAt,一条晚于它。对刚创建的 new_news 规则调用 evaluateRule,首次评估把两条都放进了通知。现有代码缺少历史游标时从 Unix 时间原点开始筛选,新建规则首次检查时可能推送历史新闻。

验证环境为 Windows、Bun 1.4.2,基于 main 的 579395e。

验收标准

  • 首次评估以规则创建时间为下限,仅把创建后发布的新闻计入新消息。
  • 后续评估继续沿用保存的检查或触发时间。用固定时钟覆盖只有历史新闻、创建后有新新闻、已有检查游标三个场景。

源码起点

验证入口 bun test packages/shared/src/alerts/evaluators.test.ts。

可以先在本条说明准备完成的范围,再评论 /claim。贡献入口见 #7。

Dominant language
TypeScript
Stars
206
Forks
37
Avg merge
8h 8m
Merged PRs (30d)
7

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ydflow/Trail

All issues in ydflow/Trail

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.