dexie-cloud-addon 4.0.5 → 4.0.6

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.0.5, Sat May 04 2024
11
+ * Version 4.0.5, Sat May 25 2024
12
12
  *
13
13
  * https://dexie.org
14
14
  *
@@ -4711,6 +4711,10 @@
4711
4711
  }
4712
4712
  const trans = req.trans;
4713
4713
  if ((_b = (_a = db.cloud.schema) === null || _a === void 0 ? void 0 : _a[tableName]) === null || _b === void 0 ? void 0 : _b.markedForSync) {
4714
+ if (trans.mode === 'versionchange') {
4715
+ // Don't mutate tables marked for sync in versionchange transactions.
4716
+ return Promise.reject(new Dexie.UpgradeError(`Dexie Cloud Addon: Cannot upgrade or populate synced table "${tableName}". See https://dexie.org/cloud/docs/best-practices`));
4717
+ }
4714
4718
  if (req.type === 'add' || req.type === 'put') {
4715
4719
  if (tableName === 'members') {
4716
4720
  for (const member of req.values) {