testdriverai 7.3.29 → 7.3.30
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.
- package/CHANGELOG.md +4 -0
- package/agent/lib/sandbox.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/agent/lib/sandbox.js
CHANGED
|
@@ -199,9 +199,6 @@ const createSandbox = (emitter, analytics, sessionInstance) => {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
async connect(sandboxId, persist = false, keepAlive = null) {
|
|
202
|
-
// Store connection params so we can re-establish after reconnection
|
|
203
|
-
this._lastConnectParams = { sandboxId, persist, keepAlive };
|
|
204
|
-
|
|
205
202
|
let reply = await this.send({
|
|
206
203
|
type: "connect",
|
|
207
204
|
persist,
|
|
@@ -210,11 +207,16 @@ const createSandbox = (emitter, analytics, sessionInstance) => {
|
|
|
210
207
|
});
|
|
211
208
|
|
|
212
209
|
if (reply.success) {
|
|
210
|
+
// Only store connection params after successful connection
|
|
211
|
+
// This prevents malformed sandboxId from being attached to subsequent messages
|
|
212
|
+
this._lastConnectParams = { sandboxId, persist, keepAlive };
|
|
213
213
|
this.instanceSocketConnected = true;
|
|
214
214
|
emitter.emit(events.sandbox.connected);
|
|
215
215
|
// Return the full reply (includes url and sandbox)
|
|
216
216
|
return reply;
|
|
217
217
|
} else {
|
|
218
|
+
// Clear any previous connection params on failure
|
|
219
|
+
this._lastConnectParams = null;
|
|
218
220
|
// Throw error to trigger fallback to creating new sandbox
|
|
219
221
|
throw new Error(reply.errorMessage || "Failed to connect to sandbox");
|
|
220
222
|
}
|