cry-synced-db-client 0.1.27 → 0.1.28

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.
package/dist/index.js CHANGED
@@ -1712,7 +1712,7 @@ class DexieDb extends Dexie {
1712
1712
  schema[SYNC_META_TABLE] = "[tenant+collection]";
1713
1713
  for (const config of collectionConfigs) {
1714
1714
  const additionalIndexes = config.indexes || [];
1715
- const indexes = ["_id", "_dirty", "_updatedAt", ...additionalIndexes.map(String)];
1715
+ const indexes = ["_id", "_dirty", "_ts", ...additionalIndexes.map(String)];
1716
1716
  schema[config.name] = indexes.join(", ");
1717
1717
  }
1718
1718
  this.version(1).stores(schema);
@@ -1877,7 +1877,7 @@ class DexieDb extends Dexie {
1877
1877
  async getNewerThan(collection, timestamp) {
1878
1878
  const table = this.getTable(collection);
1879
1879
  const normalizedTs = this.normalizeTimestamp(timestamp);
1880
- return await table.where("_updatedAt").above(normalizedTs).toArray();
1880
+ return await table.where("_ts").above(normalizedTs).toArray();
1881
1881
  }
1882
1882
  onMetaUpdated(callback) {
1883
1883
  this.metaUpdateCallbacks.add(callback);
@@ -61,7 +61,7 @@ export interface I_DexieDb {
61
61
  deleteSyncMeta(collection: string): Promise<void>;
62
62
  /** Vrne tenant */
63
63
  getTenant(): string;
64
- /** Get records newer than timestamp (uses _updatedAt index) */
64
+ /** Get records newer than timestamp (uses _ts index - server timestamp) */
65
65
  getNewerThan<T extends LocalDbEntity>(collection: string, timestamp: any): Promise<T[]>;
66
66
  /** Subscribe to metadata updates from other tabs. Returns unsubscribe function. */
67
67
  onMetaUpdated(callback: (payload: MetaUpdateBroadcast) => void): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cry-synced-db-client",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",