mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
* fix(storage): dedupe backends by resolved file path StorageFactory.create() built a new backend on every call, so two components opening the same file (DynamoDbService and DynamoDbStreamService both open dynamodb-tables.json) got independent in-memory stores. On graceful shutdown flushAll() flushed them in registration order and the stale duplicate clobbered the file. Cache backends by resolved file path so repeat create() calls reuse the same backend. Add a regression test reproducing the clobber. * fix(storage): guard lifecycle methods and harden dedup test Synchronize loadAll/flushAll/clearAll/shutdownAll on the same monitor as create(), so the /state/reset and /state/nuke endpoints can't iterate allBackends while a lazily-created service mutates it. Reset the singleton factory in the dedup test setup so it no longer depends on backend startup state or test ordering.