cry-synced-db-client 2.0.9 → 2.0.10

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/dist/index.js +20 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6022,12 +6022,26 @@ var _SyncedDb = class _SyncedDb {
6022
6022
  * @param calledFrom Diagnostic tag threaded through to upload callbacks
6023
6023
  */
6024
6024
  async flushToServer(calledFrom) {
6025
- if (!this.initialized) return;
6026
- if (!this.connectionManager.canSync()) return;
6027
- this.pendingChanges.cancelRestUploadTimer();
6028
- await this.pendingChanges.flushAll();
6029
- await this.pendingChanges.awaitRestUpload();
6030
- await this.syncEngine.uploadDirtyItems(calledFrom);
6025
+ try {
6026
+ if (!this.initialized) return;
6027
+ if (!this.connectionManager.canSync()) return;
6028
+ this.pendingChanges.cancelRestUploadTimer();
6029
+ await this.pendingChanges.flushAll();
6030
+ await this.pendingChanges.awaitRestUpload();
6031
+ await this.syncEngine.uploadDirtyItems(calledFrom);
6032
+ } catch (err) {
6033
+ console.error(`[SyncedDb] flushToServer ${(err == null ? void 0 : err.rejectMessage) || (err == null ? void 0 : err.message) || ""}`, {
6034
+ err,
6035
+ calledFrom,
6036
+ callstack: (() => {
6037
+ try {
6038
+ return new Error().stack;
6039
+ } catch (e) {
6040
+ return void 0;
6041
+ }
6042
+ })()
6043
+ });
6044
+ }
6031
6045
  }
6032
6046
  /**
6033
6047
  * Returns when all collections were last successfully synced
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",