Events 3.7.2 + Website 1.6.1: no duplicate events after a reseed; "Events site" in the header

A reseed gives every event a new id without listing the old ones in the
feed's `deleted`, and consumers only fetched ?updatedSince= after the first
sync, so the old copies stayed beside the new ones.

- Both: the 15-minute feed poll and "Sync now" fetch the whole list and
  drop copies that aren't in it; the fetch after event.changed stays
  incremental.
- Events set-demo.js keeps FeedEntry and marks its live entries removed,
  resets the links' lastGoodAt, then publishes the new feed, sends
  event.changed and fetches the linked products' events back in.
- Website loadDemo lists the old published events in FeedRemoval and sends
  event.changed after publishing.
- Website header: links to the church's other sites read "Events site"
  with an external-link icon, not a second "Events".

Checked: Website backend tests (133), Events backend tests (802), both
typechecks, Website frontend build. set-demo.js not run end to end (no
local database).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 15:35:38 +02:00
co-authored by Claude Opus 5.5
parent a75d2f7b46
commit 7f681c9e81
24 changed files with 211 additions and 29 deletions
+12
View File
@@ -188,6 +188,18 @@ describe('the public site\'s content', () => {
assert.equal((await siteContent(h.ctx)).church?.name, 'Acacia Hill Church', 'the profile saved by the first demo stays');
});
it('1.6.1: loading a demo again lists the old events as removed in the feed, so Cross Events drops its copies', async () => {
const h = await harness({ linked: false });
const dir = tmp();
await loadDemo(h.ctx, 'heritage', { uploadDir: dir });
const old = (await h.db.simpleEvent.findMany()).map((e) => e.id).sort();
assert.ok(old.length > 0);
await loadDemo(h.ctx, 'community-town', { uploadDir: dir });
assert.deepEqual((await h.db.feedRemoval.findMany()).map((r) => r.eventId).sort(), old);
const now = (await h.db.simpleEvent.findMany()).map((e) => e.id);
assert.ok(now.length > 0 && now.every((id) => !old.includes(id)));
});
it('1.3.0: a profile on a site with no church profile at all saves the demo one, so the site has a name', async () => {
const h = await harness({ linked: false });
await loadDemo(h.ctx, 'clean-campus', { uploadDir: tmp() });