@squidcloud/client 1.0.108 → 1.0.109
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/cjs/index.js +18 -6
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -29926,18 +29926,22 @@ class DebugLogger {
|
|
|
29926
29926
|
DebugLogger.info(...args);
|
|
29927
29927
|
}
|
|
29928
29928
|
static info(...args) {
|
|
29929
|
-
console.log(`%c[${
|
|
29929
|
+
console.log(`%c[${DebugLogger.getTimestampString()}] INFO`, 'color:green', ...args);
|
|
29930
29930
|
}
|
|
29931
29931
|
static warn(...args) {
|
|
29932
|
-
console.warn(`%c[${
|
|
29932
|
+
console.warn(`%c[${DebugLogger.getTimestampString()}] WARN`, 'color:yellow', ...args);
|
|
29933
29933
|
}
|
|
29934
29934
|
static error(...args) {
|
|
29935
|
-
console.error(`%c[${
|
|
29935
|
+
console.error(`%c[${DebugLogger.getTimestampString()}] ERROR`, 'color:red', ...args);
|
|
29936
29936
|
}
|
|
29937
29937
|
static debug(...args) {
|
|
29938
29938
|
if (!isDebugEnabled())
|
|
29939
29939
|
return;
|
|
29940
|
-
console.log(`%c[${
|
|
29940
|
+
console.log(`%c[${DebugLogger.getTimestampString()}] DEBUG`, 'color:cyan', ...args);
|
|
29941
|
+
}
|
|
29942
|
+
static getTimestampString() {
|
|
29943
|
+
const date = new Date();
|
|
29944
|
+
return `${date.toLocaleTimeString()}.${date.getMilliseconds()}`;
|
|
29941
29945
|
}
|
|
29942
29946
|
}
|
|
29943
29947
|
|
|
@@ -47058,6 +47062,13 @@ class MutationSender {
|
|
|
47058
47062
|
};
|
|
47059
47063
|
return await this.rpcManager.post('mutation/mutate', request);
|
|
47060
47064
|
}
|
|
47065
|
+
catch (e) {
|
|
47066
|
+
DebugLogger.debug('Error while sending mutations', {
|
|
47067
|
+
error: e,
|
|
47068
|
+
mutations: JSON.stringify(reducedMutations, null, 2),
|
|
47069
|
+
});
|
|
47070
|
+
throw e;
|
|
47071
|
+
}
|
|
47061
47072
|
finally {
|
|
47062
47073
|
this.lockManager.release(...mutexes);
|
|
47063
47074
|
}
|
|
@@ -48300,6 +48311,7 @@ class QuerySubscriptionManager {
|
|
|
48300
48311
|
this.rpcManager
|
|
48301
48312
|
.post('query/query', queryRequest)
|
|
48302
48313
|
.catch((e) => {
|
|
48314
|
+
DebugLogger.debug('Query error', ongoingQuery.query, e);
|
|
48303
48315
|
ongoingQuery.dataSubject.error(e);
|
|
48304
48316
|
ongoingQuery.done = true;
|
|
48305
48317
|
ongoingQuery.queryRegistered.error('query failed');
|
|
@@ -48568,7 +48580,7 @@ class RpcManager {
|
|
|
48568
48580
|
async postOrDelete(method, path, message) {
|
|
48569
48581
|
this.onGoingRpcCounter.next(this.onGoingRpcCounter.value + 1);
|
|
48570
48582
|
try {
|
|
48571
|
-
await this.ready();
|
|
48583
|
+
await (0,external_rxjs_namespaceObject.firstValueFrom)((0,external_rxjs_namespaceObject.from)(this.ready()).pipe((0,external_rxjs_namespaceObject.timeout)(20000)));
|
|
48572
48584
|
let headers = {
|
|
48573
48585
|
'Content-Type': 'application/json',
|
|
48574
48586
|
};
|
|
@@ -48699,8 +48711,8 @@ class SocketManager {
|
|
|
48699
48711
|
return (0,external_rxjs_namespaceObject.race)((0,external_rxjs_namespaceObject.timer)(this.clientTooOldThreshold), this.connectionReady.pipe((0,external_rxjs_namespaceObject.filter)(Boolean)), this.destructManager.observeIsDestructing());
|
|
48700
48712
|
}))
|
|
48701
48713
|
.subscribe(() => {
|
|
48702
|
-
DebugLogger.debug('Client too old but already connected. Ignoring...');
|
|
48703
48714
|
if (this.connectionReady.value || this.destructManager.isDestructing) {
|
|
48715
|
+
DebugLogger.debug('Client too old but already connected or the client is destructing. Ignoring...');
|
|
48704
48716
|
return;
|
|
48705
48717
|
}
|
|
48706
48718
|
this.clientIdService.notifyClientTooOld();
|