Skip to content

Commit d1ccc25

Browse files
committed
fix(object): _refreshCache in _finishSave
When the Op key is `a.b` _rebuildAllEstimatedData will not reset `a`. Resetting the cache will make sure the object not dirty.
1 parent 3ef4cd2 commit d1ccc25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/object.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ const {
1010
} = require('./utils');
1111

1212
const recursiveToPointer = value => {
13+
if (_.isArray(value)) return value.map(recursiveToPointer);
1314
if (_.isObject(value)) {
1415
if (value._toPointer) return value._toPointer();
1516
return _.mapObject(value, recursiveToPointer);
1617
}
17-
if (_.isArray(value)) return value.map(recursiveToPointer);
1818
return value;
1919
};
2020

@@ -516,6 +516,9 @@ module.exports = function(AV) {
516516
}
517517
});
518518
this._rebuildAllEstimatedData();
519+
const opSetQueue = this._opSetQueue.map(_.clone);
520+
this._refreshCache();
521+
this._opSetQueue = opSetQueue;
519522
this._saving = this._saving - 1;
520523
},
521524

0 commit comments

Comments
 (0)