teleportxr 1.0.79 → 1.0.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/signaling.js +10 -17
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "name": "teleportxr",
18
18
  "description": "Teleport Spatial Server on node.js",
19
- "version": "1.0.79",
19
+ "version": "1.0.80",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/simul/teleport-nodejs.git"
package/signaling.js CHANGED
@@ -129,25 +129,18 @@ function processInitialRequest(clientID, signalingClient, content) {
129
129
  // if signalingState is START, we should not have a client...
130
130
  if (signalingClient.signalingState==SignalingState.ACCEPTED||signalingClient.signalingState==SignalingState.STREAMING)
131
131
  {
132
- // ok, we've received a connection request from a client that WE think we already have.
133
- // Apparently the CLIENT thinks they've disconnected.
134
- // The client might, as far as we know, have lost the information it needs to continue the connection.
135
- // Therefore we should resend everything required.
132
+ // The client sent us another "connect" while we already hold an active
133
+ // session for them most likely the client's discovery loop ticked again
134
+ // before the client's connection-status guard kicked in. Respond
135
+ // idempotently: re-send the connect-response so the client knows we still
136
+ // recognise it, and do nothing else. Do NOT tear down the Client /
137
+ // WebRtcConnection, and do NOT re-run startStreaming — both would destroy
138
+ // the live transport (in particular leaving SetOriginNodeCommand /
139
+ // SetLightingCommand without a reliable data channel to be acked on).
136
140
  console.log(
137
- "Warning: Client " +
138
- clientID +
139
- " reconnected, but we didn't know we'd lost them."
141
+ "Warning: Client " + clientID + " sent another connect; resending connect-response."
140
142
  );
141
- // Tear down any stale Client + WebRtcConnection from the previous incarnation.
142
- // Without this the next handshake's StartStreaming() races against the old
143
- // peer connection's still-open data channels, and the reliable channel the
144
- // server publishes commands to ends up being the wrong one — Origin/Lighting
145
- // acks never come back and the server eventually gives up.
146
- disconnectClient(clientID);
147
- if (webRtcConnectionManager)
148
- webRtcConnectionManager.destroyConnection(clientID);
149
- signalingClient.ChangeSignalingState(SignalingState.START);
150
- startStreaming(signalingClient);
143
+ sendResponseToClient(clientID);
151
144
  return;
152
145
  }
153
146
  if (signalingClient.signalingState==SignalingState.REQUESTED)