Repository navigation
Reference server for protocol v0 - #1
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dropping only the sender left the reader loop running, so an app that stopped reading but kept sending stayed in presence until the pong timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The reference server for OpenBikeNet protocol v0 (OpenBikeNet/protocol#1), in Rust with axum + tokio.
protocol: parses and checks app messages and maps each problem to the spec's error codes; builds server messagesroutes: loadsroutes/*.jsonfrom theprotocol/submodule and checks the profile rulespresence: in-memory routes → rooms → riders. Join, batched updates, leave, the 200 ms per-rider rate limit and the 10 s timeout. It is pure: time is passed in, and every call returns the messages addressed to each connection.metrics: per-app daily rider-minutes, versions and first/last seen in SQLite, served atGET /v0/statsws: the/v0WebSocket endpoint. It handles the hello timeout, size and error limits, pings, the 10-connections-per-IP limit, and a 1024-message outgoing queue per connection (a slow reader is closed instead of blocking the others).obn-fake-app: a CLI that puts bot riders on a route, for manual tests and as an example for app developersdocs/design.md: fan-out now goes through addressed deliveries instead of broadcast channelsDepends on OpenBikeNet/protocol#1: the submodule points at that branch's head (
a557731), so after that PR is merged the submodule should be bumped to the merge commit.Test plan
cargo fmt --all -- --check,cargo clippy --workspace --all-targets -- -D warningscargo test --workspace: 50 tests, 3 consecutive runs green. These include every protocol example and every invalid example's error code, plus WebSocket integration tests for the full lifecycle, reconnects, the per-IP limit and the stats endpoint./v0/statsshowed both apps with the right rider counts.🤖 Generated with Claude Code