Skip to content

Commit

Permalink
Use timestamp to communicate collection_timestamp of the parent
Browse files Browse the repository at this point in the history
Don't re-use old self.timestamp when notifying of event. Instead,
re-compute it fresh.

Fixes Kinto#1769.
  • Loading branch information
glasserc committed Sep 19, 2018
1 parent 7d5544c commit ae305b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/core/notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ Payload
The :class:`kinto.core.events.ResourceChanged` and :class:`kinto.core.events.AfterResourceChanged`
events contain a ``payload`` attribute with the following information:

- **timestamp**: the time of the event
- **timestamp**: the collection timestamp of the ``(parent_id, resource_name)`` pair for
which this event was sent
- **action**: what happened. 'create', 'update' or 'delete'
- **uri**: the uri of the impacted resource
- **user_id**: the authenticated user id
Expand Down
2 changes: 1 addition & 1 deletion kinto/core/resource/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ def postprocess(self, result, action=ACTIONS.READ, old=None):

parent_id = self.get_parent_id(self.request)
self.request.notify_resource_event(parent_id=parent_id,
timestamp=self.timestamp,
timestamp=self.model.timestamp(),
data=result,
action=action,
old=old)
Expand Down

0 comments on commit ae305b9

Please sign in to comment.