Generates client side error: âException while simulating the effect of invoking âchangeShiftâ Error: Called saveOriginals twice without retrieveOriginalsâ
I have an âundo/redoâ mechanism for user edits that uses optimistic UI too. I am getting the same error when I do multiple undoâs/redoâs in a fast sequence:
Exception while simulating the effect of invoking 'songPage.imtdUnRedo' Error: Called saveOriginals twice without retrieveOriginals
at LocalCollection.saveOriginals (local_collection.js:346:13)
at Object.saveOriginals (collection.js:299:26)
at store.<computed> [as saveOriginals] (livedata_connection.js:312:38)
at livedata_connection.js:950:13
at Array.forEach (<anonymous>)
at Connection._saveOriginals (livedata_connection.js:949:33)
at Connection.apply (livedata_connection.js:646:14)
at Meteor.connection.apply (client.js:125:23)
at ns.Collection._callMutatorMethod (allow-deny.js:442:27)
at ns.Collection.update (collection.js:692:19)
The problem isnât there when doing the same sequence slowly.
I am using zodern:fix-async-stubs, and Meteor 2.16
It should be impossible to encounter Called saveOriginals twice without retrieveOriginals when using zodern:fix-async-stubs and Meteorâs public apiâs. There might be an edge case or some scenario I didnât account for.
The error stack trace seems to start at an odd location (it doesnât show why collection.update is called). Is that the full stack trace? If it is, you could try setting a breakpoint where the error is shown, and the browserâs dev tools should show a longer call stack.
If you could create a reproduction, that would be very helpful.