fix(core): address PR review — buffer ordering, flush safety, dbPath in logs
- Flush buffer before appendAgentLogBatch to prevent rowid ordering inversion when callers interleave buffered and direct writes (P1) - Wrap size-triggered flush in try-catch for consistency with timer path - Move bumpLastModified inside transactions for atomicity - Expose db.path getter and include DB path in all flush error logs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -698,6 +698,8 @@ export class Database {
|
||||
private db: DatabaseSync;
|
||||
private readonly dbPath: string;
|
||||
private readonly inMemory: boolean;
|
||||
/** Returns the database file path (or ":memory:" for in-memory databases). */
|
||||
get path(): string { return this.dbPath; }
|
||||
corruptionDetected = false;
|
||||
/** Tracks transaction nesting depth for savepoint-based nested transactions. */
|
||||
private transactionDepth = 0;
|
||||
|
||||
Reference in New Issue
Block a user