hotfix: revert BATCH_CONNECTION_REQUESTS default to False#18
Merged
agonza1 merged 1 commit intoApr 8, 2026
Merged
Conversation
PR peermetrics#13 changed the default to True, but batching is broken: 1. SDK: addConnection expects an immediate response with connection_id and peer_id. With batching, sendConnectionEvent queues the event and returns undefined, causing the SDK to throw and remove the connection. 2. API: the batch endpoint (ConnectionEventBatchView) returns an empty 200 with no connection_id or peer_id, so even if the SDK didn't crash, it couldn't map subsequent events to the connection. Reverting to False (original behavior) to prevent connection monitoring from breaking in production.
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
PR #13 changed
BATCH_CONNECTION_REQUESTSdefault fromFalsetoTrue. This breaks connection monitoring because batching is broken at two levels:SDK (client):
addConnectioncallssendConnectionEvent()and expects an immediate response withconnection_idandpeer_id. With batching enabled, the event is queued (returnsundefined), the SDK throws"There was a problem while adding this connection", and callsremoveConnection()— destroying the monitoring before it starts.API (server): The batch endpoint (
ConnectionEventBatchView.post()) returns an emptyJSONHttpResponse(status=200)with no body. The non-batch endpoint returns{ peer_id, connection_id }foraddConnectionevents — the batch endpoint does not.Fix
One-line change: default back to
False.Test plan
addConnectionsucceeds (no console errors)