dexie-cloud-addon 4.1.0-alpha.6 → 4.1.0-alpha.9

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.
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * ==========================================================================
10
10
  *
11
- * Version 4.1.0-alpha.6, Tue Oct 15 2024
11
+ * Version 4.1.0-alpha.9, Tue Oct 15 2024
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import Dexie, { PropModification, cmp, DexieYProvider, liveQuery } from 'dexie';
20
- import { Observable as Observable$1, BehaviorSubject, firstValueFrom, Subject, from as from$1, filter as filter$1, fromEvent, of, merge, mergeMap as mergeMap$1, Subscription as Subscription$1, throwError, combineLatest, map as map$1, share, timer as timer$1 } from 'rxjs';
20
+ import { Observable as Observable$1, BehaviorSubject, firstValueFrom, Subject, from as from$1, filter as filter$1, fromEvent, of, merge, mergeMap as mergeMap$1, tap as tap$1, Subscription as Subscription$1, throwError, combineLatest, map as map$1, share, timer as timer$1 } from 'rxjs';
21
21
 
22
22
  /******************************************************************************
23
23
  Copyright (c) Microsoft Corporation.
@@ -6667,7 +6667,9 @@ function createYClientUpdateObservable(db) {
6667
6667
  // If messageProducer emits empty array, nothing is emitted
6668
6668
  // but if messageProducer emits array of messages, they are
6669
6669
  // emitted one by one.
6670
- mergeMap$1((messages) => messages));
6670
+ mergeMap$1((messages) => messages), tap$1(message => {
6671
+ console.debug('dexie-cloud emitting y-c', message);
6672
+ }));
6671
6673
  }
6672
6674
 
6673
6675
  function getAwarenessLibrary(db) {
@@ -6833,12 +6835,12 @@ class WSConnection extends Subscription$1 {
6833
6835
  ws.onmessage = (event) => {
6834
6836
  if (!this.pinger)
6835
6837
  return;
6836
- console.debug('dexie-cloud WebSocket onmessage', event.data);
6837
6838
  this.lastServerActivity = new Date();
6838
6839
  try {
6839
6840
  const msg = typeof event.data === 'string'
6840
6841
  ? TSON.parse(event.data)
6841
6842
  : decodeYMessage(new Uint8Array(event.data));
6843
+ console.debug('dexie-cloud WebSocket onmessage', msg.type, msg);
6842
6844
  if (msg.type === 'error') {
6843
6845
  throw new Error(`Error message from dexie-cloud: ${msg.error}`);
6844
6846
  }
@@ -6894,6 +6896,7 @@ class WSConnection extends Subscription$1 {
6894
6896
  this.webSocketStatus.value !== 'connected') {
6895
6897
  this.webSocketStatus.next('connected');
6896
6898
  }
6899
+ console.debug('dexie-cloud WebSocket send', msg.type, msg);
6897
6900
  if (msg.type === 'ready') {
6898
6901
  (_a = this.ws) === null || _a === void 0 ? void 0 : _a.send(TSON.stringify(msg));
6899
6902
  }
@@ -7956,7 +7959,7 @@ function dexieCloud(dexie) {
7956
7959
  const syncComplete = new Subject();
7957
7960
  dexie.cloud = {
7958
7961
  // @ts-ignore
7959
- version: "4.1.0-alpha.6",
7962
+ version: "4.1.0-alpha.9",
7960
7963
  options: Object.assign({}, DEFAULT_OPTIONS),
7961
7964
  schema: null,
7962
7965
  get currentUserId() {
@@ -8258,7 +8261,7 @@ function dexieCloud(dexie) {
8258
8261
  }
8259
8262
  }
8260
8263
  // @ts-ignore
8261
- dexieCloud.version = "4.1.0-alpha.6";
8264
+ dexieCloud.version = "4.1.0-alpha.9";
8262
8265
  Dexie.Cloud = dexieCloud;
8263
8266
 
8264
8267
  // In case the SW lives for a while, let it reuse already opened connections: