| … | … | @@ -112,4 +112,23 @@ const E2 = 'did:plc:e2jevhuurrhlm36ufk7fklpg' |
| 112 | 112 | assert(log[0].ver === 1 && verifyLabel(log[0], labeler.didKey), 'and it now carries ver: 1 and verifies') |
| 113 | 113 | assert(await r.tick() === 0, 'a second tick re-signs nothing') |
| 114 | 114 | } |
| 115 | // ⛔ THE PROJECTION MUST BE OBSERVABLE. 2026-10-14: the re-signed (ver:1) member labels were in both co-owners' |
| 116 | // signed logs, yet the gateway still served the old ones, and nothing could say whether projectTo had run since |
| 117 | // boot or how long the served label core was. projectTo records its last run. |
| 118 | { |
| 119 | const sb = mockSb() |
| 120 | const r = new LabelRoom(sb, { ...KP, holds: () => true }) |
| 121 | assert(r.lastProjection === null, 'no projection before the first projectTo') |
| 122 | await r.label(E2, 'loser-club-member', { cts: '2026-10-14T00:00:09.000Z' }) |
| 123 | await r.tick() |
| 124 | const dir = mkdtempSync(join(tmpdir(), 'lrp2-')) |
| 125 | const store = new Corestore(dir) |
| 126 | const feed = store.get({ name: 'labels', valueEncoding: 'binary' }) |
| 127 | await r.projectTo(feed) |
| 128 | const p = r.lastProjection |
| 129 | assert(p && p.appended === 1 && p.coreLength === 1 && p.logLength === 1 && typeof p.at === 'number', 'lastProjection records appended / coreLength / logLength / at') |
| 130 | await r.projectTo(feed) |
| 131 | assert(r.lastProjection.appended === 0 && r.lastProjection.coreLength === 1, 'an idempotent run is recorded too') |
| 132 | await feed.close(); try { await store.close() } catch {}; rmSync(dir, { recursive: true, force: true }) |
| 133 | } |
| 115 | 134 | console.log('\nLABEL-ROOM PRESENCE OK') |