logging: address review of the SQL logging path

Only downgrade a uniqueness conflict on an INSERT, so genuine duplicate-key failures still surface. Clear old zips from the dump directory before exporting, roll the log file over at midnight, prune on roll/day-change instead of on every line, and drop the unused files-path from the FileProvider config.
This commit is contained in:
austinried
2026-10-09 07:58:55 +00:00
parent 713d9a976a
commit 9d783b2301
4 changed files with 43 additions and 17 deletions
@@ -152,10 +152,21 @@ class LogFileStoreTest {
@Test
fun detectsUpsertConflictErrors() {
assertTrue(isUpsertConflict(IllegalStateException("UNIQUE constraint failed: playback_cursor.id")))
assertTrue(isUpsertConflict(IllegalStateException("Error code: 1555, message: UNIQUE constraint failed")))
assertTrue(isUpsertConflict(IllegalStateException("SQLITE_CONSTRAINT_UNIQUE 2067")))
assertFalse(isUpsertConflict(IllegalStateException("no such table: songs")))
assertTrue(
isUpsertConflict(
"INSERT INTO playback_cursor (id) VALUES (?)",
IllegalStateException("UNIQUE constraint failed: playback_cursor.id"),
),
)
assertTrue(
isUpsertConflict(
"INSERT OR ABORT INTO t VALUES (?)",
IllegalStateException("PRIMARY KEY constraint failed"),
),
)
assertFalse(isUpsertConflict("UPDATE t SET x = 1", IllegalStateException("UNIQUE constraint failed: t.x")))
assertFalse(isUpsertConflict("SELECT * FROM t", IllegalStateException("no such table: t")))
assertFalse(isUpsertConflict("INSERT INTO t VALUES (?)", IllegalStateException("Error code: 1555")))
}
private fun execution(