Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Trigger resource events on destination collection/records #102

Merged
merged 10 commits into from
Jul 21, 2016

Conversation

leplatrem
Copy link
Contributor

This is major rewrite of the updater in order to trigger ResourceChanged events when the destination collection/records are updated (on signing).

The challenges are:

  • Leverage the resource code that builds and sends events
  • Trigger a ResourceChanged from a ResourceChanged may not be natural :)
  • Rewrite the tests since they rely on mocks and are broken

I chose to go with invoque_subrequest() instead of the kind of awful code we currently have in the default bucket plugin.

I find the result convincing and promising (most events tests pass), but I need feedback :)

@almet @Natim f?

@Natim
Copy link
Member

Natim commented Jul 20, 2016

Using the public API instead of the storage one seems like a good idea but it means you will need to have write permission for a given, while the aim was to make sure only the kinto-signer could modify the collection.

Isn't it possible to trigger the ResourceChanged event instead?
If you want to keep this approch, we need a mecanism that let plugins bypass the permission check.

@leplatrem
Copy link
Contributor Author

Ok, so that means it lacks a test where two different people modify the source collection, and the destination is updated regardless who created the destination first.

@Natim Natim changed the title [WIP] Trigger resource events on destination collection/records Trigger resource events on destination collection/records Jul 21, 2016
@leplatrem leplatrem merged commit 515ca1c into master Jul 21, 2016
@leplatrem leplatrem deleted the 101-send-resource-events branch July 21, 2016 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants