You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In method oplog_push (eve.methods.common) the document copy is not a deep one and when attribute _updated and _etag are deleted from the copy, they are deleted from the document too.
They are recomputed after (build_response_document) but not with the exact same element (_id and _updated have changed)
This happen especially for POST because argument document of oplog_push is a list. Transformation updates = [updates] is not executed so deletion on updates has impact on document
Workaround
Add {'etag_ignore_fields': ['_id', 'updated_at']} in Item Endpoints definition.
Environment
Python version: 3.6.7
Eve version: 0.8.1
The text was updated successfully, but these errors were encountered:
Expected Behavior
Element returned in response of a POST request shall have same
_etag
value than the document in the DB.In order to reproduce this, you need to set at least
OPLOG_CHANGE_METHODS=['POST']
insettings.py
Bug source suggestion
In method
oplog_push
(eve.methods.common) the document copy is not a deep one and when attribute_updated
and_etag
are deleted from the copy, they are deleted from the document too.They are recomputed after (
build_response_document
) but not with the exact same element (_id
and_updated
have changed)This happen especially for POST because argument
document
ofoplog_push
is a list. Transformationupdates = [updates]
is not executed so deletion onupdates
has impact ondocument
Workaround
Add
{'etag_ignore_fields': ['_id', 'updated_at']}
in Item Endpoints definition.Environment
The text was updated successfully, but these errors were encountered: