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

Open Beginner friendly
#2,939 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

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

Research direction

Start by reading expireSweep() in LIFEOS/TOOLS/Upgrades.ts:733-742 and its only read-path caller in LIFEOS/PULSE/modules/upgrades.ts:140-142, then compare with the /api/review handler at LIFEOS/PULSE/modules/review.ts:379-383, which serves the queue the /review page now uses. Call the sweep from that review read path (mirroring the upgrades handler) and reconcile LIFEOS/DOCUMENTATION/Upgrades/UpgradesSystem.md:38 so the documented sweep-on-read behaviour matches. Done looks like a GET /api/review request flipping expired recommended records to expired without needing /api/upgrades.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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 danielmiessler/LifeOS

All issues in danielmiessler/LifeOS

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.