Report a Join on an event without an attendees list as not recorded, and trim redundant comments

This commit is contained in:
Sylvain Duchesne
2026-11-06 23:21:38 +01:00
parent 5540d361c7
commit 9169a5817c
4 changed files with 46 additions and 45 deletions
@@ -866,6 +866,16 @@ describe('registration — a direct sign-up: a Join naming an event itself', ()
expect(w.logs.error).toEqual([]);
});
test('a Join on an event with no attendees collection is NOT recorded, loudly logged — nothing written, nothing notified', async () => {
const j = join(PLAIN);
const w = setup({ acts: [j], stored: { [PLAIN]: plainEvent(PLAIN, { 'apods:attendees': undefined }) } });
await emitJoin(w, j);
expect(w.logs.error.some(m => m.includes('NOT recorded') && m.includes('no attendees collection'))).toBe(true);
expect(writes(w.calls)).toEqual([]);
expect(ledgerOf(w, PLAIN)).toBeUndefined();
expect(participations(w)).toEqual([]);
});
const readsOf = (w, uri) => w.calls.filter(c => ['pod-resources.get', 'pod-collections.getItems'].includes(c.action) && (c.params.resourceUri ?? c.params.collectionUri) === uri);
const expectAnonymous = (w, n) => {
expect(n.recipientUri).toBe(ALICE);