Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe bridge adds usage receipt collection and acknowledgment operations. It defines protobuf messages and RPCs, registers gRPC service methods, and adds REST and gRPC client wrappers. Receipt collection is documented as non-resetting, and acknowledgment releases a receipt after durable storage. ChangesUsage Receipt API
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
|
Adds
collect_usageandacknowledge_usageto both REST and gRPC clients. The node owns a stable receipt ID and retains the receipt until the caller durably stores it and explicitly acknowledges it. Repeating collection or ACK is safe; this client never falls back to destructiveGetStats(reset=True)and never acknowledges automatically.The protobuf contract and generated bindings add
UsageRequest,UsageReceipt,UsageAck,CollectUsage, andAcknowledgeUsage. Existing stats APIs remain unchanged. An empty receipt ID with no stats means there is no new traffic and requires no ACK.Companion panel: PasarGuard/panel#946. Requires the companion node receipt protocol: PasarGuard/node#94. Merge/release the node and Bridge before activating receipt accounting in the panel; drain legacy collectors before activation. The Bridge release containing these methods is a runtime prerequisite of the panel change.
Validation: current local suite 71 passed with ResourceWarning treated as an error; Ruff passed. External local tests exercised both transports against the actual Go controller handlers over TLS, killed/restarted the server between collection and ACK, checked identical replay, repeated ACK, empty polls, and rejection of legacy resets. Both transport scenarios passed. Two additional real Go → Bridge → panel/SQLite recovery scenarios also passed: all 1,111 bytes were recovered once after a panel staging failure and node process restart.
No test, documentation, or benchmark files are included. This is a reliability protocol addition, not a claim of faster RPC throughput.
Merged current
mainand regenerated Python protobuf bindings from the combined schema, preserving both receipt RPCs and MASQUE. The receipt message definitions and RPC signatures match the companion node schema exactly.Current-head upstream CI is
action_requiredand needs a repository maintainer to approve the run: https://github.com/PasarGuard/node_bridge_py/actions/runs/40007811299 . Local validation is reported separately above.