SetConnected in internal/metrics/metrics.go counts a reconnect only when the stream was still marked connected or the count is already above zero. streamWithReconnect in internal/streamer/streamer.go always marks the stream disconnected before it connects again, so neither holds and the count stays 0. Each reconnect loses the updates sent while the stream was down, and this count is where /api/v1/stats would show them.
Failure scenario, confirmed with a throwaway test: SetConnected(true), SetConnected(false), SetConnected(true), SetConnected(false), SetConnected(true) leaves GetReconnectCount() at 0 instead of 2.
Severity: low
Definition of done
A test, failing before the fix: that sequence gives a reconnect count of 2.
Every connection after the first counts one reconnect.
make check passes.
Model: opus-5-5
`SetConnected` in `internal/metrics/metrics.go` counts a reconnect only when the stream was still marked connected or the count is already above zero. `streamWithReconnect` in `internal/streamer/streamer.go` always marks the stream disconnected before it connects again, so neither holds and the count stays 0. Each reconnect loses the updates sent while the stream was down, and this count is where `/api/v1/stats` would show them.
Failure scenario, confirmed with a throwaway test: `SetConnected(true)`, `SetConnected(false)`, `SetConnected(true)`, `SetConnected(false)`, `SetConnected(true)` leaves `GetReconnectCount()` at 0 instead of 2.
Severity: low
## Definition of done
- A test, failing before the fix: that sequence gives a reconnect count of 2.
- Every connection after the first counts one reconnect.
- `make check` passes.
Model: opus-5-5
clawbot
self-assigned this 2026-10-14 14:50:32 +02:00
#77 counts one reconnect for every connection after the first, with the test this issue asks for.
Model: opus-5-5
https://git.eeqj.de/sneak/routewatch/pulls/77 counts one reconnect for every connection after the first, with the test this issue asks for.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
SetConnectedininternal/metrics/metrics.gocounts a reconnect only when the stream was still marked connected or the count is already above zero.streamWithReconnectininternal/streamer/streamer.goalways marks the stream disconnected before it connects again, so neither holds and the count stays 0. Each reconnect loses the updates sent while the stream was down, and this count is where/api/v1/statswould show them.Failure scenario, confirmed with a throwaway test:
SetConnected(true),SetConnected(false),SetConnected(true),SetConnected(false),SetConnected(true)leavesGetReconnectCount()at 0 instead of 2.Severity: low
Definition of done
make checkpasses.Model: opus-5-5
#77 counts one reconnect for every connection after the first, with the test this issue asks for.
Model: opus-5-5