dexie-cloud-addon 4.3.7 → 4.3.8

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.8, 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,9 @@
17298
17298
  };
17299
17299
  }
17300
17300
 
17301
- const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(UNAUTHORIZED_USER));
17301
+ const isOathCallback = typeof location !== 'undefined' && !!(new URL(location.href)).searchParams.get('dxc-auth');
17302
+ const getCurrentUserEmitter = associate((db) => new rxjs.BehaviorSubject(isOathCallback
17303
+ ? Object.assign(Object.assign({}, UNAUTHORIZED_USER), { oauthInProgress: true }) : UNAUTHORIZED_USER));
17302
17304
 
17303
17305
  function computeSyncState(db) {
17304
17306
  let _prevStatus = db.cloud.webSocketStatus.value;
@@ -17933,7 +17935,7 @@
17933
17935
  const syncComplete = new rxjs.Subject();
17934
17936
  dexie.cloud = {
17935
17937
  // @ts-ignore
17936
- version: "4.3.7",
17938
+ version: "4.3.8",
17937
17939
  options: Object.assign({}, DEFAULT_OPTIONS),
17938
17940
  schema: null,
17939
17941
  get currentUserId() {
@@ -17974,8 +17976,6 @@
17974
17976
  try {
17975
17977
  const callback = parseOAuthCallback();
17976
17978
  if (callback) {
17977
- // Clean up URL immediately (remove dxc-auth param)
17978
- cleanupOAuthUrl();
17979
17979
  // Store the pending auth code for processing when db is ready
17980
17980
  pendingOAuthCode = { code: callback.code, provider: callback.provider };
17981
17981
  console.debug('[dexie-cloud] OAuth callback detected, auth code stored for processing');
@@ -17983,7 +17983,6 @@
17983
17983
  }
17984
17984
  catch (error) {
17985
17985
  // parseOAuthCallback throws OAuthError on error callbacks
17986
- cleanupOAuthUrl();
17987
17986
  if (error instanceof OAuthError) {
17988
17987
  pendingOAuthError = error;
17989
17988
  console.error('[dexie-cloud] OAuth callback error:', error.message);
@@ -18211,6 +18210,9 @@
18211
18210
  message: error.message,
18212
18211
  messageParams: { provider: error.provider || 'unknown' }
18213
18212
  });
18213
+ // Clean up URL (remove dxc-auth param)
18214
+ cleanupOAuthUrl();
18215
+ currentUserEmitter.next(Object.assign(Object.assign({}, currentUserEmitter.value), { oauthInProgress: false }));
18214
18216
  }
18215
18217
  catch (uiError) {
18216
18218
  console.error('[dexie-cloud] Failed to show OAuth error alert:', uiError);
@@ -18224,6 +18226,8 @@
18224
18226
  try {
18225
18227
  changedUser = yield login(db, { oauthCode: code, provider });
18226
18228
  user = yield db.getCurrentUser();
18229
+ // Clean up URL (remove dxc-auth param)
18230
+ cleanupOAuthUrl();
18227
18231
  }
18228
18232
  catch (error) {
18229
18233
  console.error('[dexie-cloud] OAuth login failed:', error);
@@ -18318,7 +18322,7 @@
18318
18322
  }
18319
18323
  }
18320
18324
  // @ts-ignore
18321
- dexieCloud.version = "4.3.7";
18325
+ dexieCloud.version = "4.3.8";
18322
18326
  Dexie.Cloud = dexieCloud;
18323
18327
 
18324
18328
  // In case the SW lives for a while, let it reuse already opened connections: