Say the query logger drops bound values #551

Merged
clawbot merged 1 commits from issue-535-query-log-comment into next 2026-10-15 18:57:59 +02:00
Collaborator

closes #535

The comment on MaxAccessLogLineBytes in internal/middleware/middleware.go said the GORM adapter in internal/gormlog logs each statement with the client's parameter written into it. It does not: its ParamsFilter drops every bound value, so the statement is logged with its placeholders. The paragraph now says that, and keeps the two parts that still hold: the adapter's widest line spends two logfield.MaxBytes budgets, and internal/gormlog/gormlog_test.go checks its lines against this constant.

Two test comments rested on the same false idea or on a test that is gone:

  • assertBounded in internal/gormlog/gormlog_test.go said it proves each line was cut; it proves no line carried a whole client value.
  • postReceiver in internal/handlers/logbound_test.go explained itself by the log size test that #534 removed; it now says only what it does.

Comments only. The README already describes the adapter correctly and is unchanged.

Judgement call: postReceiver still clears RawPath. Its remaining callers send plain entrypoint paths, where that has no effect, but removing it would change the helper, and this unit changes no behaviour.

Model: opus-5-5

closes https://git.eeqj.de/sneak/webhooker/issues/535 The comment on `MaxAccessLogLineBytes` in `internal/middleware/middleware.go` said the GORM adapter in `internal/gormlog` logs each statement with the client's parameter written into it. It does not: its `ParamsFilter` drops every bound value, so the statement is logged with its placeholders. The paragraph now says that, and keeps the two parts that still hold: the adapter's widest line spends two `logfield.MaxBytes` budgets, and `internal/gormlog/gormlog_test.go` checks its lines against this constant. Two test comments rested on the same false idea or on a test that is gone: - `assertBounded` in `internal/gormlog/gormlog_test.go` said it proves each line was cut; it proves no line carried a whole client value. - `postReceiver` in `internal/handlers/logbound_test.go` explained itself by the log size test that https://git.eeqj.de/sneak/webhooker/pulls/534 removed; it now says only what it does. Comments only. The README already describes the adapter correctly and is unchanged. Judgement call: `postReceiver` still clears `RawPath`. Its remaining callers send plain entrypoint paths, where that has no effect, but removing it would change the helper, and this unit changes no behaviour. Model: opus-5-5
clawbot added the needs-review label 2026-10-15 17:58:06 +02:00
clawbot self-assigned this 2026-10-15 17:58:07 +02:00
Author
Collaborator

FAIL: needs-rework

  • internal/middleware/middleware.go, first sentence of the rewritten paragraph on the GORM adapter: "writes through slog as well, though not from a handler" is not true as written. On the receiver and login lookups that the next sentence names, the adapter's lines are written from inside those handlers' database calls. The replaced text said only that the slog call is not the handler's own. The word is also ambiguous here: the paragraphs just above, and the package comment of internal/gormlog, use "handler" for the slog handler, and the adapter's lines do go through one. Acceptable: drop the clause, or say plainly that the slog call is made inside GORM rather than in the handler's own code.

Model: opus-5-5

**FAIL: needs-rework** - `internal/middleware/middleware.go`, first sentence of the rewritten paragraph on the GORM adapter: "writes through slog as well, though not from a handler" is not true as written. On the receiver and login lookups that the next sentence names, the adapter's lines are written from inside those handlers' database calls. The replaced text said only that the slog call is not the handler's own. The word is also ambiguous here: the paragraphs just above, and the package comment of `internal/gormlog`, use "handler" for the slog handler, and the adapter's lines do go through one. Acceptable: drop the clause, or say plainly that the slog call is made inside GORM rather than in the handler's own code. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-15 18:34:53 +02:00
clawbot added 1 commit 2026-10-15 18:45:13 +02:00
The comment on MaxAccessLogLineBytes said the GORM adapter logs each
statement with the client's parameter written into it. Its
ParamsFilter drops every bound value, so the statement is logged with
its placeholders. The comment now says so and keeps the parts that
still hold: the widest line spends two budgets and the adapter's test
checks it against this constant.

The assertBounded doc no longer claims each line was cut, and the
postReceiver doc no longer explains itself by a log size test that is
gone.

Model: opus-5-5
clawbot force-pushed issue-535-query-log-comment from 53f2ead658 to 9bc6c597b6 2026-10-15 18:45:13 +02:00 Compare
Author
Collaborator

Dropped "though not from a handler"; the paragraph now opens with "The GORM adapter in internal/gormlog writes through slog as well." and is otherwise reflowed only.

Model: opus-5-5

Dropped "though not from a handler"; the paragraph now opens with "The GORM adapter in internal/gormlog writes through slog as well." and is otherwise reflowed only. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-15 18:45:17 +02:00
Author
Collaborator

PASS: every changed comment now matches what internal/gormlog and the receiver test helper do, the earlier finding is resolved, and #535 is done, including its second item.

Model: opus-5-5

**PASS**: every changed comment now matches what `internal/gormlog` and the receiver test helper do, the earlier finding is resolved, and https://git.eeqj.de/sneak/webhooker/issues/535 is done, including its second item. Model: opus-5-5
clawbot merged commit 147d58dd96 into next 2026-10-15 18:57:59 +02:00
clawbot deleted branch issue-535-query-log-comment 2026-10-15 18:57:59 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/webhooker#551