[management] State the sqlite precision caveat without the review history

A comment explaining why the truncation guard sits on the type recorded how
the gap came to be noticed rather than the constraint itself, which AGENTS.md
rules out. The technical point is the one worth keeping: sqlite preserves
nanoseconds, so a sqlite-only suite cannot observe the truncation.

The neighbouring back-compatibility comment gets the same treatment — "clients
written before this existed" leans on the reader knowing what "this" was, and
naming conditional requests outright says it plainly.
This commit is contained in:
Brad Ison
2026-08-11 12:33:23 +02:00
parent 29eff3b207
commit 6c9267c7d3
2 changed files with 5 additions and 5 deletions

View File

@@ -130,8 +130,8 @@ func TestUpdateSettingsPreconditionSerializesConcurrentWriters(t *testing.T) {
// TestUpdateSettingsUnconditionalIgnoresStaleness pins the back-compatibility
// half: without a precondition the manager keeps last-write-wins, which is
// what the dashboard relies on and what every client written before this
// existed does.
// what the dashboard relies on and what any client that predates conditional
// requests does.
func TestUpdateSettingsUnconditionalIgnoresStaleness(t *testing.T) {
ctx := context.Background()
f := newBootstrapFixture(t)

View File

@@ -131,9 +131,9 @@ func TestSettings_ETagExclusions(t *testing.T) {
// precision, the validator a bootstrap hands out never matches again and the
// documented "conditional PUT without an intervening GET" is a permanent 412.
//
// Asserted here on the type rather than through a store, so it holds without
// running the suite against every engine — which is what let this through the
// first time, since sqlite preserves nanoseconds and every other test uses it.
// Asserted on the type rather than through a store, so it holds without running
// the suite against every engine. The sqlite test store preserves nanoseconds,
// so a sqlite-only suite cannot observe the truncation at all.
func TestSettings_ETagSurvivesTimestampTruncation(t *testing.T) {
inMemory := etagSettings()
require.NotZero(t, inMemory.CreatedAt.Nanosecond(), "the fixture must carry sub-second precision to prove anything")