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