ReviewOS

also looking at this

pantry-pm/pantry

fix: hydrate durable registry snapshots before serving writes

#244
Merged chris wants to merge codex/wildloop-registry-rollout into main
11 files +202 -35
packages/registry/src/server.tsmodified+10-1
Changes to packages/registry/src/server.ts
@@ -6846,7 +6846,16 @@ if (import.meta.main) {
68466846 // Ensure auth storage uses the same DynamoDB table as the registry
68476847 const authStorage = createAuthStorage(dynamoTable, awsRegion)
68486848
6849 const { start } = createServer(registry, port, analytics, undefined, undefined, undefined, authStorage)
6849 const zigStorage = createZigStorage()
6850 const phpStorage = createPhpStorage()
6851 // Hydrate durable state before accepting any request that can mutate it.
6852 // Only a confirmed missing object can initialize an empty registry.
6853 await Promise.all([registry.metadata, analytics, authStorage, zigStorage, phpStorage].map(async (store) => {
6854 if ('ready' in store && typeof store.ready === 'function')
6855 await store.ready()
6856 }))
6857
6858 const { start } = createServer(registry, port, analytics, zigStorage, undefined, phpStorage, authStorage)
68506859 start()
68516860
68526861 console.log('\nEnvironment:')