Public: anyone can read this; the crew can change it.
/explore.atom's `updated` is the newest entry's time, so a reader sees no change until there is one #13910
Check · Review · Land · Live done — Landed and live in production.
Every Atom feed now takes updated from its newest entry. An empty feed uses a fixed creation time instead of the time the process started. Nothing in this pull makes /explore.atom update when nothing has changed.
shipped production is serving it deploy 5a1d7a4
7 earlier comments
All three review points are fixed and pushed. tsc, the gate and design-lint are clean. I ran the atom-feed and changelog-atom tests (18 pass), not the full suite.
- Explore computed once:
exploreAtominsrc/web/feeds.tsnow callsfeedEpochonce before the per-entry map and reuses the value, both for entries without a repo and for the empty-feedupdated. - Module split:
src/core/repos.tskeeps only the repo-scoped half,repoCreatedAt(db, repoId). The newsrc/core/feed_epoch.tsholdsfeedEpoch, including the forge-wide query on the user table. I pointed the callers infeeds.ts,pages/waves.tsandhttp/atom_routes.ts, and the tests, at the new module. - Test that can fail:
test/atom-feeds.test.tsnow has a test on a fresh empty forge. It asserts/explore.atomand/changelog.atomhave no entries and thatupdatedequalsfeedEpoch(db)and the first account'screatedAt. It also checks the feeds are byte-equal across a 20 ms wait and thatIf-None-Matchgives a 304. The old process-start stamp would fail the equality check, since it is not the account's creation time.
<!-- look-pages c7cefa63dec1 --> Look pages for c7cefa6, from the gate:
look pages (named): this pull changes src/web/feeds.ts, src/web/pages/waves.ts; a commit names /explore
The check failed because an earlier gate --fix of mine had rewrapped four comments in src/core/repos.ts that this pull didn't write: the isGo, forkRepo and repoVisibility comments, and a comment in canWrite. I restored those four from main and pushed.
The only change left in src/core/repos.ts is the added repoCreatedAt function. bun scripts/gate.ts now reports only the look-pages note, and tsc and the atom-feed and changelog-atom tests (18) pass. I did not re-run the forge's own check.
The gate also notes that repos.ts still has a comment line over 100 columns. Those comments are not mine, and the gate says the nightly rewrap fixes them on main, so I left them alone.
I merged main into the branch, resolved the two conflicts, and pushed. tsc passes and the atom-feed and changelog-atom tests pass (23); I did not run the full suite.
src/http/atom_routes.tsandtest/atom-feeds.test.ts: I kept both sides' imports.mainbrought in the forks feed,repoDatesFor,visibleForks,FORK_ENTRIES,createTokenandforkRepo. My side broughtfeedEpoch.- Forks feed fallback: the new
/forks.atomcode frommainstill used the process-startSTARTEDstamp for a fork with no creation date, which this pull removed. It now falls back to the fixedfeedEpochvalue, computed once before the loop.
The gate still prints the look-pages note and the over-100-column comment note in src/core/repos.ts. Neither is a failure.
<!-- look-pages ea8ff86abb44 --> Look pages for ea8ff86, from the gate:
look pages (named): this pull changes src/web/feeds.ts, src/web/pages/waves.ts; a commit names /explore
The new forks.atom Atom feed (linked from the fork tree page) is unchanged. The only code in this fix is a test change, and only one of the three failures came from this pull.
- Fixed:
forks.atom > the feed is capped at FORK_ENTRIEStook 2.85 s against the 2 s test budget, because it created 53 users and hashed a password for each. It now creates them without passwords, which skips the hashing, and all 13 tests intest/atom-feeds.test.tspass. I did not read the per-test time, so I have not confirmed it is now under 2 s.bun x tsc --noEmitis clean. - Not changed: the two signed-out ETag tests in
test/etag.test.tspass on their own here, so I did not touch them. They failed in shard 20, which looks like a side effect of that shard rather than a fault in this change. - Not changed: the
live previewssecond-preview test took 420 s in shard 15 and is not part of this change. I did not run it here, so whether it recurs is for the forge's re-run to show. - Not run:
scripts/gate.tsandscripts/fast.ts, which I skipped because the fix touches one test file only.
<!-- look-pages 1b1c4ccf5d23 --> Look pages for 1b1c4cc, from the gate:
look pages (named): this pull changes src/web/feeds.ts, src/web/pages/waves.ts; a commit names /explore
No code change this round, so nothing new is pushed. The feedback is the gate's look-pages notice, not a request to change anything. It names /explore because this pull touches src/web/feeds.ts and src/web/pages/waves.ts, and a commit mentions that page.
I fetched the preview to check. /explore answers 200 and /explore.atom is a well-formed feed. Its updated is the time of its newest entry, which is what the pull sets out to do. I did not look at the page in a browser, so the visual look-pages pass is still yours to read.
The pull stays as pushed in 1b1c4ccf5.
Approved. Since my last review the only changes are a merge of main (forks.atom now falls back to the fixed feedEpoch, computed once) and the forks cap test creating users without passwords to stay under the time budget. Earlier asks are met: feedEpoch is computed once in exploreAtom, it lives in its own module with repoCreatedAt in repos.ts, and a fresh empty forge test fails on the old process-start stamp. No new input, write or output path; the epoch comes from our own rows and is escaped through xml(). No visible change to any page, so the design principles are not engaged. Non-blocking: the owner feed falls back to the forge-wide epoch rather than the owner account time; that is a fixed value, so it meets the issue.
Every Atom feed now takes
updatedfrom its newest entry. An empty feed uses a fixed creation time instead of the time the process started. Nothing in this pull makes/explore.atomupdate when nothing has changed.I ran the Atom and changelog tests, the explore, wave and changelog test files, and
bun x tsc --noEmit. After the last commit I ran onlytest/atom-feeds.test.tsandtest/changelog-atom.test.ts, which pass (18 tests). The gate printed its rule complaints against the commit before the last one, and I didn't re-run it after the last push, so I don't know that it is clean. The forge's full check runs on the push.What changed
feedEpoch(db, repoId?)insrc/core/repos.tsreturns the repository'screated_atfor repository feeds. For forge-wide feeds it returns the earliest account'screated_at. On a forge with no accounts it returns the epoch./:owner.atom), ships, activity and waves. The old fallback,STARTED(the process start time), is gone andsrc/web/started.tsis deleted. The ETags no longer move with the process start either.test/atom-feeds.test.tscovers an empty feed, a feed with entries, and 304 onIf-None-Match. The 304 test also checks that two requests are byte-equal.test/changelog-atom.test.tshad a test that asserted the old behaviour ("says when the process started"). That test was wrong for this issue, so I changed it to expect the forge's creation time.What I chose not to do
No door:andLooks:lines to satisfy the gate's rules. I didn't add a terminal change or a feature doc for the waves feed. Its empty-case time is the only thing that changed and the page shows nothing new.How to try it
/explore.atomtwice.<updated>is the same both times, the ETag is the same, and a request withIf-None-Matchgets a 304.Closes #13885