-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
We're going to introduce a new listener for kinto-changes, and that will probably be the more important one for our use case, but it's still worth keeping the old one around in case it's of use to someone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised! I would have expected a simple exclude_match setting!
Since we called it «kinto changes», can't we assume kinto-changes would be installed? And maybe read the kinto.changes.resources
setting? This way we could just have an exclude param, like we have kinto.history.exclude_resources
if resource_name == 'bucket': | ||
resource_bucket = matchdict['id'] | ||
else: | ||
resource_bucket = matchdict.get('bucket_id') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key is probably always present no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so. In principle, we have other resources that don't belong in buckets, although kinto-changes
doesn't watch them.
resource_collection = matchdict.get('collection_id') | ||
|
||
if resource_bucket and resource_bucket != record_bucket: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this go before line 56?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? In my mind, it was "Fetch bucket/collection from the resource, then check if the record matches".
Following up from a discussion I had with Mat. If you first come to this PR, you might expect a clean/elegant Another thing that came up when discussing this is whether we really need to have two listeners. Megaphone is pretty limited in scope to Firefox and Mozilla, and the only use case we have for it right now is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks
Thanks @leplatrem for drawing my attention to this.
Thanks @leplatrem for the correction.
Thanks @leplatrem for the suggestion.
Another point that came up during discussion is that this plugin doesn't really care what's in the kinto-changes configuration. We don't match the |
Fixes #12.