internal/db: SetSessionWallops is dead production code after the #96 B2 refactor #102

Closed
opened 2026-09-04 08:49:23 +02:00 by clawbot · 1 comment
Collaborator

Non-blocking finding from the round-7 review of #96 (which PASSed and is merge-ready). Filing separately rather than blocking that PR.

(*Database).SetSessionWallops at internal/db/queries.go:2485 has no remaining non-test callers. PR #96's B2 fix moved session mode writes into a single atomic transaction in the service layer, which removed the last production call site.

Verified at edbbdc9c:

$ grep -rn SetSessionWallops --include='*.go' .
internal/db/queries.go:2483:// SetSessionWallops sets the wallops (+w) flag on a
internal/db/queries.go:2485:func (database *Database) SetSessionWallops(
internal/service/service_test.go:386:	_ = env.db.SetSessionWallops(ctx, sid, true)
internal/service/service_test.go:708:		if err := database.SetSessionWallops(

Both surviving callers are tests. Because the method is exported, golangci-lint's unused check does not flag it, so this will not surface on its own.

Suggested fix: delete the method and rewrite the two test call sites to go through the same atomic path production now uses — otherwise the tests are exercising a code path that no longer exists in production.

Small and self-contained; agent-eligible if you want to label it.

Non-blocking finding from the round-7 review of #96 (which PASSed and is merge-ready). Filing separately rather than blocking that PR. `(*Database).SetSessionWallops` at `internal/db/queries.go:2485` has no remaining non-test callers. PR #96's B2 fix moved session mode writes into a single atomic transaction in the service layer, which removed the last production call site. Verified at `edbbdc9c`: ``` $ grep -rn SetSessionWallops --include='*.go' . internal/db/queries.go:2483:// SetSessionWallops sets the wallops (+w) flag on a internal/db/queries.go:2485:func (database *Database) SetSessionWallops( internal/service/service_test.go:386: _ = env.db.SetSessionWallops(ctx, sid, true) internal/service/service_test.go:708: if err := database.SetSessionWallops( ``` Both surviving callers are tests. Because the method is exported, `golangci-lint`'s `unused` check does not flag it, so this will not surface on its own. Suggested fix: delete the method and rewrite the two test call sites to go through the same atomic path production now uses — otherwise the tests are exercising a code path that no longer exists in production. Small and self-contained; agent-eligible if you want to label it.
Author
Collaborator

Closed at sneak's instruction, 2026-09-05: this was opened by an agent running on another machine outside the managed fleet, under superseded rules. Reopen if the content is wanted.

Model: fable-5-1

Closed at sneak's instruction, 2026-09-05: this was opened by an agent running on another machine outside the managed fleet, under superseded rules. Reopen if the content is wanted. Model: fable-5-1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#102