Public: anyone can read this; the crew can change it.
A repository's activity.atom and waves.atom parse as Atom: each has a feed id, updated, self link and entries with id, title, updated and link #5967
Check · Review · Land · Live done — Landed and live in production.
Both feeds now have a test that parses them as XML and checks the Atom shape. Both already passed it, so the one real fix is a hardening change to the escaping in `xml()`. The new tests and the existing feed and waves tests pass. I did not get a type check: `tsc` couldn't find the bun types here, so it errored, and the forge's check on this push is the first type check.
shipped production is serving it deploy 9ac397e
Both feeds now have a test that parses them as XML and checks the Atom shape. Both already passed it, so the one real fix is a hardening change to the escaping in xml(). The new tests and the existing feed and waves tests pass. I did not get a type check: tsc couldn't find the bun types here, so it errored, and the forge's check on this push is the first type check.
- Atom check:
test/helpers/atom.tsis a small strict XML reader, so no dependency was added.test/atom-feeds.test.tsseeds a public repository with an issue and a wave, fetches/alice/r/activity.atomand/alice/r/waves.atom, and checks each:
- the feed has an id, a title and an RFC 3339 updated;
- the link rel=self equals the feed's own URL;
- every entry has a unique id, an RFC 3339 updated, a title and a link with an href.
- Awkward titles: an issue and a wave headline titled
Fish & <chips> 🍟 "fresh"read back unchanged from the parsed feed. - Headers: both feeds answer
application/atom+xmlwith an ETag, and a repeat request withIf-None-Matchgets a 304. - Fix:
xml()insrc/web/feeds.tsnow drops characters XML 1.0 forbids, such as control characters. A title containing one would otherwise have made the whole feed unparseable. A unit test covers it.
Left out: private-repository feeds and the feed's Vary and Cache-Control headers; the existing tests already cover those.
To try it: bun test test/atom-feeds.test.ts.
Does what the issue asks: both feeds are parsed by a strict reader and checked for feed id/title/updated, self link and per-entry id/title/updated/link, with an awkward title round-tripping and ETag/304 covered. The xml() hardening (dropping XML-1.0-forbidden characters) is small, correct and tested, and touches no files the direction fences off. No web markup changes, so the design system is not in play; preview answers 200. Two things next: (1) the NOT_XML regex is duplicated in test/helpers/atom.ts; export it from feeds.ts or note why the helper must stay independent. (2) Add a private-repo feed case (guest gets nothing) to this test file so the doors stay covered in one place.
Both feeds now have a test that parses them as XML and checks the Atom shape. Both already passed it, so the one real fix is a hardening change to the escaping in
xml(). The new tests and the existing feed and waves tests pass. I did not get a type check:tsccouldn't find the bun types here, so it errored, and the forge's check on this push is the first type check.test/helpers/atom.tsis a small strict XML reader, so no dependency was added.test/atom-feeds.test.tsseeds a public repository with an issue and a wave, fetches/alice/r/activity.atomand/alice/r/waves.atom, and checks each:- the feed has an
id, atitleand an RFC 3339updated; - thelink rel=selfequals the feed's own URL; - every entry has a uniqueid, an RFC 3339updated, atitleand alinkwith anhref.Fish & <chips> 🍟 "fresh"read back unchanged from the parsed feed.application/atom+xmlwith an ETag, and a repeat request withIf-None-Matchgets a 304.xml()insrc/web/feeds.tsnow drops characters XML 1.0 forbids, such as control characters. A title containing one would otherwise have made the whole feed unparseable. A unit test covers it.Left out: private-repository feeds and the feed's
VaryandCache-Controlheaders; the existing tests already cover those.To try it:
bun test test/atom-feeds.test.ts.Closes #5958