stream in internal/streamer/streamer.go adds a peer to its peer set on an OPEN message and removes it on a NOTIFICATION; the size of that set is stream.bgp_peer_count in /api/v1/stats. A peer whose session was already up when RouteWatch connected sends no OPEN, and a session that goes down arrives as a STATE message with "state":"down", which is ignored. So the count starts at 0 while updates arrive from hundreds of peers, counts only peers that opened a session since startup, and keeps peers whose session went down.
Failure scenario: docs/message-examples.json, a few seconds of the live feed, has updates from many peers and no OPEN message; fed that stream, the count stays 0.
Severity: low
Definition of done
A test, failing before the fix: messages of any type from two peers give a count of 2, and a NOTIFICATION or a STATE message with "state":"down" from one of them brings it to 1.
make check passes.
Model: opus-5-5
`stream` in `internal/streamer/streamer.go` adds a peer to its peer set on an `OPEN` message and removes it on a `NOTIFICATION`; the size of that set is `stream.bgp_peer_count` in `/api/v1/stats`. A peer whose session was already up when RouteWatch connected sends no `OPEN`, and a session that goes down arrives as a `STATE` message with `"state":"down"`, which is ignored. So the count starts at 0 while updates arrive from hundreds of peers, counts only peers that opened a session since startup, and keeps peers whose session went down.
Failure scenario: `docs/message-examples.json`, a few seconds of the live feed, has updates from many peers and no `OPEN` message; fed that stream, the count stays 0.
Severity: low
## Definition of done
- A test, failing before the fix: messages of any type from two peers give a count of 2, and a `NOTIFICATION` or a `STATE` message with `"state":"down"` from one of them brings it to 1.
- `make check` passes.
Model: opus-5-5
clawbot
self-assigned this 2026-10-14 14:50:34 +02:00
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.
streamininternal/streamer/streamer.goadds a peer to its peer set on anOPENmessage and removes it on aNOTIFICATION; the size of that set isstream.bgp_peer_countin/api/v1/stats. A peer whose session was already up when RouteWatch connected sends noOPEN, and a session that goes down arrives as aSTATEmessage with"state":"down", which is ignored. So the count starts at 0 while updates arrive from hundreds of peers, counts only peers that opened a session since startup, and keeps peers whose session went down.Failure scenario:
docs/message-examples.json, a few seconds of the live feed, has updates from many peers and noOPENmessage; fed that stream, the count stays 0.Severity: low
Definition of done
NOTIFICATIONor aSTATEmessage with"state":"down"from one of them brings it to 1.make checkpasses.Model: opus-5-5