[bug] Upgrades 30-day TTL sweep only runs when something reads GET /api/upgrades, and…

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

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
api, backend

调研方向

先阅读 expireSweep()(位于 LIFEOS/TOOLS/Upgrades.ts:733-742),以及它在 LIFEOS/PULSE/modules/upgrades.ts:140-142 中唯一的读路径调用方,然后与 /api/review handler(位于 LIFEOS/PULSE/modules/review.ts:379-383)比较,该 handler 服务于 /review 页面现在使用的队列。从该 review 读路径调用 sweep(仿照 upgrades handler),并协调 LIFEOS/DOCUMENTATION/Upgrades/UpgradesSystem.md:38,使文档化的 sweep-on-read 行为保持一致。完成的标准看起来是:GET /api/review 请求无需 /api/upgrades 就能将过期的 recommended 记录翻转为 expired。

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

描述

What happened

Upgrades 30-day expiry never fires from the /review page, so expired recommendations stay open

Summary

LIFEOS/DOCUMENTATION/Upgrades/UpgradesSystem.md:38 says the 30-day TTL is "swept opportunistically on each Pulse API read", and the only caller of expireSweep() (LIFEOS/TOOLS/Upgrades.ts:733-742) on a read path is GET /api/upgrades (LIFEOS/PULSE/modules/upgrades.ts:140-142). Since the page moved into /review (UpgradesSystem.md:66, app/upgrades/page.tsx:3-6), the queue is read through GET /api/review (app/review/page.tsx:366, LIFEOS/PULSE/modules/review.ts:379-383), which never calls expireSweep(); /review only POSTs to /api/upgrades/... (page.tsx:460). Nothing in the release schedules Upgrades.ts expire (:818-821); the only other reader of GET /api/upgrades is TOOLS/PulseFreshness.ts:44, which is run by hand. On one install 13 recommended records whose expires fell between Nov 2 and Nov 22 stayed recommended until a request happened to hit GET /api/upgrades.

Suggested fix: call expireSweep() in GET /api/review too, or note in UpgradesSystem.md that Upgrades.ts expire needs a schedule.

Related: #2742 (closed) touches expire in the same file; the sweep-on-read behaviour it mentions is the one /review no longer reaches.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

主要语言
TypeScript
星标
19.9k
派生
2.5k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

danielmiessler/LifeOS 的其他 Issue

查看 danielmiessler/LifeOS 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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