You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(config): drop meaningless DefaultSettings UpdatedAt timestamps #1051
internal/config/defaults.go stamps UpdatedAt: time.Now() on every entry of
the DefaultSettings slice. These are static compile-time defaults; the
timestamp reflects the binary start time, not when any setting was actually
updated. This is meaningless and misleading (finding 04-N2 from report 04).
Evidence: 28 entries in DefaultSettings each carry UpdatedAt: time.Now()
which evaluates once at package init. Any code comparing this value to a
real user-updated timestamp from the DB will get a false-positive "recently
changed" signal. The existing test TestDefaultSettings_UpdatedAtSet asserts
non-zero + recently-set, reinforcing the wrong contract.
Fix
Replace all UpdatedAt: time.Now() calls in defaults.go with UpdatedAt: time.Time{} (zero value), which clearly signals "never written
by a user". Update TestDefaultSettings_UpdatedAtSet to assert the zero
value instead.
Blast-radius:DefaultSettings is only iterated inside defaults.go
helper functions. No runtime code reads setting.UpdatedAt from these static
entries. The DB updated_at column is populated by NOW() in SQL, not from
this Go field. The zero value is safe.
Note on 04-M1 (getEnvInt/getEnvFloat warn logging)
The companion finding 04-M1 (warn on malformed env int/float values) is
already fully addressed by PR #1040 (fix/server-transport-config): getEnvInt, getEnvFloat, and getTaskTimeout all log WARNING: on parse
failure in that branch. This issue tracks only the residual 04-N2 item.
Activity
fix(config): replace meaningless time.Now() in DefaultSettings with z…