dexie-cloud-addon 4.3.7 → 4.3.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.3.7, Wed Jan 28 2026
11
+ * Version 4.3.9, Thu Jan 29 2026
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -13207,7 +13207,7 @@
13207
13207
  *
13208
13208
  * ==========================================================================
13209
13209
  *
13210
- * Version 4.2.2, Wed Jan 28 2026
13210
+ * Version 4.2.2, Thu Jan 29 2026
13211
13211
  *
13212
13212
  * https://dexie.org
13213
13213
  *
@@ -17298,7 +17298,7 @@
17298
17298
  };
17299
17299
  }
17300
17300
 
17301
- const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(UNAUTHORIZED_USER));
17301
+ const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(Object.assign(Object.assign({}, UNAUTHORIZED_USER), { isLoading: true })));
17302
17302
 
17303
17303
  function computeSyncState(db) {
17304
17304
  let _prevStatus = db.cloud.webSocketStatus.value;
@@ -17933,7 +17933,7 @@
17933
17933
  const syncComplete = new rxjs.Subject();
17934
17934
  dexie.cloud = {
17935
17935
  // @ts-ignore
17936
- version: "4.3.7",
17936
+ version: "4.3.9",
17937
17937
  options: Object.assign({}, DEFAULT_OPTIONS),
17938
17938
  schema: null,
17939
17939
  get currentUserId() {
@@ -17974,8 +17974,6 @@
17974
17974
  try {
17975
17975
  const callback = parseOAuthCallback();
17976
17976
  if (callback) {
17977
- // Clean up URL immediately (remove dxc-auth param)
17978
- cleanupOAuthUrl();
17979
17977
  // Store the pending auth code for processing when db is ready
17980
17978
  pendingOAuthCode = { code: callback.code, provider: callback.provider };
17981
17979
  console.debug('[dexie-cloud] OAuth callback detected, auth code stored for processing');
@@ -17983,7 +17981,6 @@
17983
17981
  }
17984
17982
  catch (error) {
17985
17983
  // parseOAuthCallback throws OAuthError on error callbacks
17986
- cleanupOAuthUrl();
17987
17984
  if (error instanceof OAuthError) {
17988
17985
  pendingOAuthError = error;
17989
17986
  console.error('[dexie-cloud] OAuth callback error:', error.message);
@@ -18177,7 +18174,14 @@
18177
18174
  // Manage CurrentUser observable:
18178
18175
  throwIfClosed();
18179
18176
  if (!db.cloud.isServiceWorkerDB) {
18180
- subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser()).subscribe(currentUserEmitter));
18177
+ subscriptions.push(Dexie.liveQuery(() => db.getCurrentUser().then(user => {
18178
+ if (!user.isLoggedIn && typeof location !== 'undefined' && /dxc-auth\=/.test(location.search)) {
18179
+ // Still loading user because OAuth redirect just happened.
18180
+ // Keep isLoading true.
18181
+ return Object.assign(Object.assign({}, user), { isLoading: true });
18182
+ }
18183
+ return user;
18184
+ })).subscribe(currentUserEmitter));
18181
18185
  // Manage PersistendSyncState observable:
18182
18186
  subscriptions.push(Dexie.liveQuery(() => db.getPersistedSyncState()).subscribe(db.cloud.persistedSyncState));
18183
18187
  // Wait till currentUser and persistedSyncState gets populated
@@ -18211,6 +18215,8 @@
18211
18215
  message: error.message,
18212
18216
  messageParams: { provider: error.provider || 'unknown' }
18213
18217
  });
18218
+ // Clean up URL (remove dxc-auth param)
18219
+ cleanupOAuthUrl();
18214
18220
  }
18215
18221
  catch (uiError) {
18216
18222
  console.error('[dexie-cloud] Failed to show OAuth error alert:', uiError);
@@ -18224,6 +18230,8 @@
18224
18230
  try {
18225
18231
  changedUser = yield login(db, { oauthCode: code, provider });
18226
18232
  user = yield db.getCurrentUser();
18233
+ // Clean up URL (remove dxc-auth param)
18234
+ cleanupOAuthUrl();
18227
18235
  }
18228
18236
  catch (error) {
18229
18237
  console.error('[dexie-cloud] OAuth login failed:', error);
@@ -18318,7 +18326,7 @@
18318
18326
  }
18319
18327
  }
18320
18328
  // @ts-ignore
18321
- dexieCloud.version = "4.3.7";
18329
+ dexieCloud.version = "4.3.9";
18322
18330
  Dexie.Cloud = dexieCloud;
18323
18331
 
18324
18332
  // In case the SW lives for a while, let it reuse already opened connections: