feat(federation): shared epoch types + getInstanceId()

This commit is contained in:
Jannis Braun
2026-07-01 21:19:25 +02:00
parent d8f2b1a9c7
commit 7acf48d0a4
6 changed files with 131 additions and 1 deletions
+6 -1
View File
@@ -53,9 +53,11 @@ beforeEach(async () => {
// Seed the singleton instance_settings row mirroring ensureDefaults() —
// tests don't run the boot-time helper, so we insert manually with the
// schema-default values for the new federatedRegistrationOpen column.
// schema-default values for the new federatedRegistrationOpen column plus
// the persistent epoch (instanceId) that ensureDefaults mints on boot.
testDb.insert(schema.instanceSettings).values({
id: 1,
instanceId: '123e4567-e89b-12d3-a456-426614174000',
updatedAt: Date.now(),
}).run();
@@ -94,5 +96,8 @@ describe('GET /api/instance/info', () => {
expect(typeof body.sourceCodeUrl).toBe('string');
expect(body.sourceCodeUrl).toMatch(/^https?:\/\//);
expect(body.commit === null || typeof body.commit === 'string').toBe(true);
// Persistent per-instance epoch (incarnation UUID) is always advertised.
expect(typeof body.instanceId).toBe('string');
expect(body.instanceId).toMatch(/^[0-9a-f-]{36}$/);
});
});