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

Allow changefeed event data to be processed by after hooks #75

Merged
merged 2 commits into from
Mar 26, 2017

Conversation

daffl
Copy link
Member

@daffl daffl commented Mar 25, 2017

Real-time events are not being sent with the final data if you modify them in an after hook. The problem is that we are sending the plain changefeed data instead of the data processed through hooks in a normal method call. The current solution is to run the after hook chain for the given method manually.

@daffl daffl changed the title WIP: Events are not being sent with after hook data Allow changefeed event data to be processed by after hooks Mar 25, 2017
@marshallswain
Copy link
Member

Makes sense. :shipit:

@daffl daffl merged commit dd8d26a into master Mar 26, 2017
@daffl daffl deleted the hooks-problem branch March 26, 2017 00:32
@jeffijoe
Copy link

jeffijoe commented Apr 4, 2017

Is it possible to disable this? It's breaking my production system because I rely on things set in before hooks.

@daffl
Copy link
Member Author

daffl commented Apr 4, 2017

I can add a flag. For now just stick with v0.3.x since this is the only thing that changed in (the version incompatible) 0.4.

@jeffijoe
Copy link

jeffijoe commented Apr 4, 2017

I added a unlessNoProvider(innerHook) instead, my OCD won't allow me to have outdated packages.

runHooks('remove', data.old_val)
.then(hook => this.emit('removed', hook.result));
} else {
runHooks('patch', data.new_val).then(hook => {
Copy link

@maksnester maksnester Apr 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know which hooks, for patch or for update should be used here?
It seems like 'update' hooks won't be called.

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

4 participants