diff --git a/CHANGELOG.md b/CHANGELOG.md index 24dd2579c..854d382d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ * `View.isView` * `Filter.isFilter` +### 🐞 Bug Fixes + +* Fixed error encountered when attempting to `store.revert()` on a store with summary records. + ### 🎁 New Features * Enhanced `Field.rules` to support `warning` and `info` severity. Useful for non-blocking diff --git a/data/Store.ts b/data/Store.ts index a4c98f537..6dc88eb6b 100644 --- a/data/Store.ts +++ b/data/Store.ts @@ -1221,12 +1221,14 @@ export class Store const recToRevert = records.find(it => it.id === summaryRec.id); if (!recToRevert) return summaryRec; + // StoreRecordConfig requires data to be a "new object dedicated to this StoreRecord". + const data = {...recToRevert.committedData}; const ret = new StoreRecord({ id: recToRevert.id, store: this, raw: recToRevert.raw, - data: recToRevert.committedData, - committedData: recToRevert.committedData, + data, + committedData: data, parent: null, isSummary: true });