Give a second snapshot create in the same second its own ID #277

Merged
clawbot merged 1 commits from fix-same-second-snapshot-id into next 2026-10-08 03:29:08 +02:00
1 Commits
Author SHA1 Message Date
sneak 37028b298d Give a second snapshot create in the same second its own ID (closes #270)
check / check (push) Waiting to run
The timestamp in a snapshot ID is in whole seconds, so a `snapshot
create` that started in the same second as the previous run of that
snapshot name got the same ID, and inserting its row failed with
`UNIQUE constraint failed: snapshots.id`. CreateSnapshotWithName now
looks the ID up in the local index first and, if it is taken, waits a
second and takes a new timestamp. The ID format is unchanged.

Only the local index is checked. That is where the insert fails, and
the process lock serializes runs, so nothing takes the ID between the
lookup and the insert.

Model: opus-5-5
2026-10-08 00:41:06 +00:00