@phpsandbox/sdk 0.0.19 → 0.0.22
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/dist/browser/phpsandbox-sdk.esm.js +28 -2
- package/dist/browser/phpsandbox-sdk.esm.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.esm.min.js.map +3 -3
- package/dist/browser/phpsandbox-sdk.iife.js +28 -2
- package/dist/browser/phpsandbox-sdk.iife.js.map +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js +2 -2
- package/dist/browser/phpsandbox-sdk.iife.min.js.map +3 -3
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/socket/index.d.ts +1 -0
- package/dist/socket/index.d.ts.map +1 -1
- package/dist/socket/index.js +26 -1
- package/dist/socket/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -2962,6 +2962,7 @@ var Transport = class {
|
|
|
2962
2962
|
this.closed = false;
|
|
2963
2963
|
this.disposables = new NamedDisposable();
|
|
2964
2964
|
this.connectPromise = null;
|
|
2965
|
+
this.pingIntervalStarted = false;
|
|
2965
2966
|
// Connection health monitoring
|
|
2966
2967
|
this.connectionStats = {
|
|
2967
2968
|
connectTime: 0,
|
|
@@ -3040,7 +3041,25 @@ var Transport = class {
|
|
|
3040
3041
|
throw new Error("Unexpected message type: " + typeof ev.data);
|
|
3041
3042
|
}
|
|
3042
3043
|
ev.data.arrayBuffer().then((buffer) => {
|
|
3043
|
-
|
|
3044
|
+
if (buffer.byteLength === 0) {
|
|
3045
|
+
this.log("warn", "Ignoring empty WebSocket frame");
|
|
3046
|
+
return;
|
|
3047
|
+
}
|
|
3048
|
+
try {
|
|
3049
|
+
this.handleRawMessage(decode(buffer));
|
|
3050
|
+
} catch (error) {
|
|
3051
|
+
this.connectionStats.totalErrors++;
|
|
3052
|
+
this.log("error", "Failed to decode WebSocket frame", {
|
|
3053
|
+
error: error instanceof Error ? error.message : String(error),
|
|
3054
|
+
byteLength: buffer.byteLength
|
|
3055
|
+
});
|
|
3056
|
+
this.eventEmitter.emit("transport.error", {
|
|
3057
|
+
type: "message_decode_error",
|
|
3058
|
+
error,
|
|
3059
|
+
rawMessage: buffer,
|
|
3060
|
+
timestamp: Date.now()
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3044
3063
|
});
|
|
3045
3064
|
};
|
|
3046
3065
|
this.rws.addEventListener("message", onMessage);
|
|
@@ -3685,6 +3704,10 @@ connect_fn = function() {
|
|
|
3685
3704
|
return this.connectPromise;
|
|
3686
3705
|
};
|
|
3687
3706
|
startPeriodicPing_fn = function() {
|
|
3707
|
+
if (this.pingIntervalStarted || this.closed) {
|
|
3708
|
+
return;
|
|
3709
|
+
}
|
|
3710
|
+
this.pingIntervalStarted = true;
|
|
3688
3711
|
this.disposables.add("pingInterval", () => {
|
|
3689
3712
|
const interval = setInterval(async () => {
|
|
3690
3713
|
try {
|
|
@@ -3708,6 +3731,7 @@ startPeriodicPing_fn = function() {
|
|
|
3708
3731
|
return {
|
|
3709
3732
|
dispose: () => {
|
|
3710
3733
|
clearInterval(interval);
|
|
3734
|
+
this.pingIntervalStarted = false;
|
|
3711
3735
|
}
|
|
3712
3736
|
};
|
|
3713
3737
|
});
|
|
@@ -4757,10 +4781,12 @@ _initPromise = new WeakMap();
|
|
|
4757
4781
|
_NotebookInstance_instances = new WeakSet();
|
|
4758
4782
|
init_fn = function() {
|
|
4759
4783
|
__privateSet(this, _initPromise, new Promise((resolve, reject) => {
|
|
4760
|
-
this.onDidInitialize((result) => {
|
|
4784
|
+
const initializationListener = this.onDidInitialize((result) => {
|
|
4785
|
+
initializationListener.dispose();
|
|
4761
4786
|
this.initialized = result;
|
|
4762
4787
|
if (result.type === "error") {
|
|
4763
4788
|
reject(new NotebookInitError(result.message, result.data));
|
|
4789
|
+
return;
|
|
4764
4790
|
}
|
|
4765
4791
|
resolve(result);
|
|
4766
4792
|
});
|