GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — Hosted Go redirect leaves the superseded gopatch module's go.sum lines behind when a newer patch replaces an existing redirect, so `go mod tidy` is no longer a no-op · Issue #682 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:goGo modulesGo modulespriority:p2 Description[agent] Found by the scheduled Go modules bug-hunt routine (ledger #317). SummaryWhen hosted mode re-redirects a Go module that already carries a Socket hosted docs/ecosystems.md ("Go: directory replaces and go.sum") says "The rewriter removes the replaced version's original sum lines to keep the result stable under Impact
Repro (Linux, hermetic HTTP GOPROXY plus a local mock patch API, as in
|
| OS | go | variant | reproduces |
|---|---|---|---|
| Linux | 1.24.7 | new uuid | yes (3×) |
| Linux | 1.24.7 | same uuid, socketpatch.1 → .2 |
yes |
| Linux | 1.26.8 | new uuid | yes (tidy -diff exit 1) |
| Linux | 1.21.13 | new uuid | yes (go mod tidy shrinks go.sum from 4 lines to 2) |
| Linux | 1.24.7 | first redirect only (no prior) | no (tidy is a no-op) |
The bug is pure go.mod/go.sum text logic, so it doesn't depend on the OS. It isn't a regression: the 4.0.0 release (npm) behaves the same way. Tested on main 045d7ec.
crates/socket-patch-core/src/patch/redirect/mod.rs, rewrite_golang:
:6808: prior (the existing Socket hosted directive, with its rhs_module/rhs_version) is captured, but on the normal refresh path it's only used for the ledger original text.:6932: go_sum.upsert_module_lines(rhs_module, rhs_version, …) only replaces lines keyed on the new module version. Lines for the prior rhs_module/rhs_version are never removed.:6859: the version-mismatch branch already prunes stale.rhs_module lines. The refresh path needs the same treatment when prior.owner == Hosted and (rhs_module, rhs_version) changed.Not related to #631 (that issue is a refactor of the same go_sum_edit.rs file).
[agent] Triaged: priority:p2 (Go modules). Not a duplicate of #549 (rollback after tidy) or #631 (refactor): this is the hosted refresh path in rewrite_golang not pruning the prior Socket target's go.sum pair. No open or merged PR addresses it yet.
Generated by Claude Code