@pol-studios/db 1.0.50 → 1.0.52

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 (35) hide show
  1. package/dist/{DataLayerContext--jqUiEMX.d.ts → DataLayerContext-C7cJtiO8.d.ts} +3 -3
  2. package/dist/auth/context.js +2 -2
  3. package/dist/auth/hooks.js +3 -3
  4. package/dist/auth/index.js +3 -3
  5. package/dist/{chunk-RJIVXO4U.js → chunk-3Q74DK5K.js} +44 -48
  6. package/dist/chunk-3Q74DK5K.js.map +1 -0
  7. package/dist/{chunk-DKUF2FKB.js → chunk-DP3YEVSX.js} +2 -2
  8. package/dist/{chunk-7CLN4ORU.js → chunk-EOJGUOJR.js} +681 -693
  9. package/dist/chunk-EOJGUOJR.js.map +1 -0
  10. package/dist/{chunk-GY7HDOBA.js → chunk-FIAXWEBK.js} +4 -4
  11. package/dist/{chunk-FLGHJCW3.js → chunk-FMYXG4VN.js} +2 -2
  12. package/dist/{chunk-WBMZDH2U.js → chunk-GSORUAS7.js} +19 -6
  13. package/dist/chunk-GSORUAS7.js.map +1 -0
  14. package/dist/{chunk-AIYPSXIO.js → chunk-WQLIGVQR.js} +15 -13
  15. package/dist/{chunk-AIYPSXIO.js.map → chunk-WQLIGVQR.js.map} +1 -1
  16. package/dist/hooks/index.d.ts +2 -2
  17. package/dist/hooks/index.js +2 -2
  18. package/dist/{index-CJ8GAb_-.d.ts → index-jVYdTeWx.d.ts} +1 -1
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +7 -7
  21. package/dist/index.native.d.ts +5 -5
  22. package/dist/index.native.js +7 -7
  23. package/dist/index.web.d.ts +6 -6
  24. package/dist/index.web.js +6 -6
  25. package/dist/types/index.d.ts +2 -2
  26. package/dist/{useDbCount-DeXtNH0E.d.ts → useDbCount-DHLJzmkO.d.ts} +1 -1
  27. package/dist/{useResolveFeedback-HTdDM4AQ.d.ts → useResolveFeedback-B0UcYWVI.d.ts} +3 -3
  28. package/dist/with-auth/index.js +5 -5
  29. package/package.json +1 -1
  30. package/dist/chunk-7CLN4ORU.js.map +0 -1
  31. package/dist/chunk-RJIVXO4U.js.map +0 -1
  32. package/dist/chunk-WBMZDH2U.js.map +0 -1
  33. /package/dist/{chunk-DKUF2FKB.js.map → chunk-DP3YEVSX.js.map} +0 -0
  34. /package/dist/{chunk-GY7HDOBA.js.map → chunk-FIAXWEBK.js.map} +0 -0
  35. /package/dist/{chunk-FLGHJCW3.js.map → chunk-FMYXG4VN.js.map} +0 -0
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useDbUpsert
3
- } from "./chunk-RJIVXO4U.js";
3
+ } from "./chunk-3Q74DK5K.js";
4
4
  import {
5
5
  UserMetadata
6
6
  } from "./chunk-SM73S2DY.js";
7
7
  import {
8
8
  useSetupAuth
9
- } from "./chunk-FLGHJCW3.js";
9
+ } from "./chunk-FMYXG4VN.js";
10
10
  import {
11
11
  useDbQuery
12
- } from "./chunk-DKUF2FKB.js";
12
+ } from "./chunk-DP3YEVSX.js";
13
13
  import {
14
14
  useSupabase
15
15
  } from "./chunk-DMVUEJG2.js";
@@ -467,4 +467,4 @@ export {
467
467
  useSetUserMetadata,
468
468
  useUserMetadataState
469
469
  };
470
- //# sourceMappingURL=chunk-GY7HDOBA.js.map
470
+ //# sourceMappingURL=chunk-FIAXWEBK.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  permissionContext,
3
3
  setupAuthContext
4
- } from "./chunk-DKUF2FKB.js";
4
+ } from "./chunk-DP3YEVSX.js";
5
5
 
6
6
  // src/auth/hooks/useAuth.ts
7
7
  import { isUsable } from "@pol-studios/utils";
@@ -205,4 +205,4 @@ export {
205
205
  useInvalidatePermission,
206
206
  usePermissionLoading
207
207
  };
208
- //# sourceMappingURL=chunk-FLGHJCW3.js.map
208
+ //# sourceMappingURL=chunk-FMYXG4VN.js.map
@@ -3,12 +3,12 @@ import {
3
3
  createAdapterRegistry,
4
4
  createSupabaseAdapter,
5
5
  stripSchemaPrefix
6
- } from "./chunk-7CLN4ORU.js";
6
+ } from "./chunk-EOJGUOJR.js";
7
7
  import {
8
8
  DataLayerContext,
9
9
  DataLayerCoreContext,
10
10
  DataLayerStatusContext
11
- } from "./chunk-AIYPSXIO.js";
11
+ } from "./chunk-WQLIGVQR.js";
12
12
  import {
13
13
  QueryExecutor,
14
14
  extractRelationNames,
@@ -1572,8 +1572,12 @@ function DataLayerProvider({
1572
1572
  return unsubscribe;
1573
1573
  }, [autoDetector]);
1574
1574
  useEffect(() => {
1575
- if (!autoDetector) return;
1576
- autoDetector.updateSyncStatus(powerSyncSyncStatus ?? null);
1575
+ const currentDetector = registry.getAutoDetector();
1576
+ if (!currentDetector) return;
1577
+ if (powerSyncInstance && currentDetector.getPowerSync() !== powerSyncInstance) {
1578
+ currentDetector.setPowerSyncDb(powerSyncInstance);
1579
+ }
1580
+ currentDetector.updateSyncStatus(powerSyncSyncStatus ?? null);
1577
1581
  setStatus((prev) => {
1578
1582
  const newHasSynced = powerSyncSyncStatus?.hasSynced ?? false;
1579
1583
  const newIsOnline = powerSyncSyncStatus?.isOnline;
@@ -1590,7 +1594,16 @@ function DataLayerProvider({
1590
1594
  }
1591
1595
  };
1592
1596
  });
1593
- }, [autoDetector, powerSyncSyncStatus?.hasSynced, powerSyncSyncStatus?.connected, powerSyncSyncStatus?.connecting, powerSyncSyncStatus?.isOnline]);
1597
+ }, [
1598
+ // Note: We use registry.getAutoDetector() instead of autoDetector state
1599
+ // to avoid race conditions. The registry is stable and always has the latest detector.
1600
+ registry,
1601
+ powerSyncInstance,
1602
+ powerSyncSyncStatus?.hasSynced,
1603
+ powerSyncSyncStatus?.connected,
1604
+ powerSyncSyncStatus?.connecting,
1605
+ powerSyncSyncStatus?.isOnline
1606
+ ]);
1594
1607
  useEffect(() => {
1595
1608
  if (registry) {
1596
1609
  registry.setSyncTracker({
@@ -4955,4 +4968,4 @@ object-assign/index.js:
4955
4968
  @license MIT
4956
4969
  *)
4957
4970
  */
4958
- //# sourceMappingURL=chunk-WBMZDH2U.js.map
4971
+ //# sourceMappingURL=chunk-GSORUAS7.js.map