diff --git a/src/shared/utils/autoSeed.ts b/src/shared/utils/autoSeed.ts index 77b7e06..0cafcf8 100644 --- a/src/shared/utils/autoSeed.ts +++ b/src/shared/utils/autoSeed.ts @@ -23,11 +23,14 @@ * for the gate's purpose (stopping the dev seed from bloating a persistent * wallet) and is therefore left out until someone actually wants to opt in. * - * `fixtureSeedEnabled()` BELOW IS NOT ENFORCED in `bootstrapWallet` here. On - * ng-eventually it switches every route off, which stands down the @data - * scenarios that seed; adopting that is a product decision, not a side effect of - * recovering this file. Until it is taken, only the AUTOMATIC seed is gated — an - * explicit `loadTestData()` still writes. + * `fixtureSeedEnabled()` BELOW IS DELIBERATELY NOT ENFORCED in `bootstrapWallet` + * here, and it is not a decision left pending: the intent behind it — stated + * 2026-09-21 — was to stop the dev app from creating fixtures BY ITSELF, and + * using fixtures in TESTS was never a problem. `autoSeedEnabled()` above is + * exactly that intent. The master switch overshoots it, because it also silences + * an explicit `loadTestData()`; on ng-eventually that cost the @data suite its + * fixtures (a caveat still open there). So the gate that governs the automatic + * seed is the one wired, and an explicit seed still writes. */ /** diff --git a/src/shared/utils/ngBootstrap.ts b/src/shared/utils/ngBootstrap.ts index 55fa464..fe120b7 100644 --- a/src/shared/utils/ngBootstrap.ts +++ b/src/shared/utils/ngBootstrap.ts @@ -84,9 +84,19 @@ export async function bootstrapWallet( const graph = await ensureGraphNuri(ngUsers, ngParticipations); console.log('[Bootstrap] Using graph NURI:', graph); - // Seed users — one at a time with ORM flush between each + // Seed users — one at a time with ORM flush between each. + // + // ONLY A FEW, not all fourteen. The connected seed is LINEAR in the number of + // documents (one document per entity, each a serial round trip), so it writes + // only what is needed. Nothing in the @data layer looks a seeded profile up by + // name; what it needs is that SOME profile exists — one to answer + // `currentUserId`, and a non-empty set for "the wallet contains users". The + // first three are kept rather than one, so a participants list has somebody to + // show, and `@mariedupont` is among them because `FestipodDataContext` falls + // back to her when the account layer has not resolved. + const SEEDED_PROFILES = 3; const userIdMap = new Map(); - for (const u of seedUsers) { + for (const u of seedUsers.slice(0, SEEDED_PROFILES)) { ngUsers.add({ "@graph": graph, "@type": "http://festipod.org/UserProfile", @@ -122,23 +132,12 @@ export async function bootstrapWallet( } console.log('[Bootstrap] Seeded', eventIdMap.size, 'events'); - // Seed participations with mapped IDs — one at a time - let partCount = 0; - for (const p of seedParticipations) { - const eventIri = eventIdMap.get(p.eventId) || p.eventId; - const userIri = userIdMap.get(p.userId) || p.userId; - ngParticipations.add({ - "@graph": graph, - "@type": "http://festipod.org/Participation", - "@id": "", - event: eventIri, - user: userIri, - isConfirmed: p.isConfirmed, - } as FpParticipation); - await flushAndWait(); - partCount++; - } - console.log('[Bootstrap] Seeded', partCount, 'participations'); + // NO PARTICIPATIONS. The sign-up scenarios create theirs live, which is the + // behaviour they exist to exercise, and nothing asserts on a seeded one: a + // scenario's starting participant count is SET on the event + // (`updateEvent({ participantCount })`) and read back from it, never counted + // from Participation documents. Writing five here would cost five more serial + // round trips to furnish something no test looks at. return { seeded: true, userIdMap, eventIdMap }; }