Using revert
in beforeSave triggers doesn't return the correct response
#7838
Labels
type:bug
Impaired feature or lacking behavior that is likely assumed
New Issue Checklist
Issue Description
As discussed here, using
revert
doesn't work due torevert
removing ops for the key, so the keys' update won't be returned by the API.I.e, for an update of a key foo, the server will respond:
{ 'foo' : 'bar' }
And the client will merge that with the existing object, so
{'name': 'f'}
would become{'name': 'f', 'foo': 'bar'}
However, when
revert
is used, the server responds with{}
, which gets merged with the clients' JSON of{ 'foo' : 'bar' }
, meaning the client thinks the key update was successful.Steps to reproduce
Actual Outcome
Keys are updated
Expected Outcome
Keys to be reverted
Environment
Server
alpha
macos
localhost
Database
mongo
5
local
Client
JS
latest
Logs
The text was updated successfully, but these errors were encountered: