Skip to content

fix(server): wait for concurrent SQLite writers instead of failing with SQLITE_BUSY - #5134

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
ostapondo:fix/sqlite-busy-timeout
Aug 15, 2026
Merged

juliusmarminge merged 1 commit into
pingdotgg:mainfrom
ostapondo:fix/sqlite-busy-timeout

fix(server): wait for concurrent SQLite writers instead of failing wi…

dd2121d
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Effect Service Conventions succeeded Aug 9, 2026 in 47s

All clear

All clear

Details

Note

Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.


🔍 Agent activity — reasoning, no tool calls

💭 The change is straightforward—I'm adding a PRAGMA statement and a test. For the imports, I'm using namespace imports for the effect modules which aligns with the conventions, and the test imports from the vitest package are standard named imports. The Sqlite.ts imports are from a layer module rather than a Context, so the service boundary namespace import rule doesn't apply here. Looking at the import patterns in the test file, I notice it's importing from Sqlite.ts as a direct import rather than using a namespace import, but the existing convention for similar layer modules like NodeSqliteClient uses namespace imports. The question is whether this violates the service boundary convention, which seems to require namespace imports at service boundaries—though Sqlite.ts exports layers rather than a service tag, so the rule might not apply here. The bigger concern I'm spotting is that the test uses Effect.promise with a raw promise that can reject, which could cause a defect rather than a typed error—Effect.tryPromise would be more appropriate. There's also the spawned child process that isn't being scoped or cleaned up properly, creating a potential resource leak, though that's not explicitly covered in the conventions. The use of NodeFS.mkdtempSync outside of Effect and manual cleanup with Effect.ensuring is acceptable since tests are allowed to use node builtins with diagnostics disabled. Looking at the specifics: the PRAGMA busy_timeout query correctly returns a column named timeout, and SqlitePersistenceMemory doesn't require FileSystem since it's in-memory. The layer composition looks fine—Effect.provide(SqlitePersistenceMemory) works because the memory layer has no dependencies, and the first test properly provides NodeServices.layer to the live persistence layer. I don't see any convention violations here, so this should pass the check.


Agent Credits: 41 credits