A comment in the middleware says the query logger writes client values into statements; it drops them #535

Closed
opened 2026-10-15 10:49:38 +02:00 by clawbot · 2 comments
Collaborator

What is wrong. The comment above MaxAccessLogLineBytes in internal/middleware/middleware.go says the GORM adapter in internal/gormlog "logs the statement with the client-chosen parameter already interpolated into it". It does not: ParamsFilter in internal/gormlog/gormlog.go drops every bound value, so a logged statement carries only its ? placeholders. The paragraph's reasoning (why that writer is held to the access-log line budget) rests on the false premise.

What acceptable looks like. The comment describes what the adapter logs today, or the paragraph goes if nothing in it still holds; the size check in internal/gormlog/gormlog_test.go stays as it is unless it, too, relies on the false premise.

Definition of done. Every sentence of that comment is true against internal/gormlog.

Model: opus-5-5

**What is wrong.** The comment above `MaxAccessLogLineBytes` in `internal/middleware/middleware.go` says the GORM adapter in `internal/gormlog` "logs the statement with the client-chosen parameter already interpolated into it". It does not: `ParamsFilter` in `internal/gormlog/gormlog.go` drops every bound value, so a logged statement carries only its `?` placeholders. The paragraph's reasoning (why that writer is held to the access-log line budget) rests on the false premise. **What acceptable looks like.** The comment describes what the adapter logs today, or the paragraph goes if nothing in it still holds; the size check in `internal/gormlog/gormlog_test.go` stays as it is unless it, too, relies on the false premise. **Definition of done.** Every sentence of that comment is true against `internal/gormlog`. Model: opus-5-5
clawbot self-assigned this 2026-10-15 10:49:38 +02:00
Author
Collaborator

Same unit: the comment on postReceiver in internal/handlers/logbound_test.go still explains itself by the log size budget test that #534 removed. Make it say only what the helper does now, or what the tests that call it still need.

Model: opus-5-5

Same unit: the comment on `postReceiver` in `internal/handlers/logbound_test.go` still explains itself by the log size budget test that https://git.eeqj.de/sneak/webhooker/pulls/534 removed. Make it say only what the helper does now, or what the tests that call it still need. Model: opus-5-5
Author
Collaborator

#551 rewrites the paragraph so it says the adapter logs each statement with its placeholders, and keeps the parts that still hold. The assertBounded and postReceiver comments are corrected in the same commit. No code changes.

Model: opus-5-5

https://git.eeqj.de/sneak/webhooker/pulls/551 rewrites the paragraph so it says the adapter logs each statement with its placeholders, and keeps the parts that still hold. The `assertBounded` and `postReceiver` comments are corrected in the same commit. No code changes. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#535