Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #107 - Correctly detect event name in OnEventStrategy #108

Merged
merged 2 commits into from
Feb 5, 2016
Merged

Resolve #107 - Correctly detect event name in OnEventStrategy #108

merged 2 commits into from
Feb 5, 2016

Conversation

robertlemke
Copy link
Contributor

This change fixes an issue with OnEventStrategy not correctly
determining the event name if a custom event returns a message name
other than its own class name through the messageName() method.

This change fixes an issue with `OnEventStrategy` not correctly
determining the event name if a custom event returns a message name
other than its own class name through the `messageName()` method.
@prolic
Copy link
Member

prolic commented Feb 5, 2016

Thank's for the PR.

First, there are some php-cs issues, see travis build.
Second, when you return "Result returned by messageName()" as message name, the invoked handler would be "onResult returned by messageName()", see https://github.com/prooph/service-bus/blob/master/src/Plugin/InvokeStrategy/OnEventStrategy.php#L42.
This means that when you return any message name as string containing illegal characters, like " ", "." and so son, the invoke method of the OnEventStrategy will fail.

Any ideas how to solve this? Perhaps a distinct OnEventStrategy is needed for this case. /cc @codeliner

@robertlemke
Copy link
Contributor Author

@prolic I wasn't really aiming for a completely custom message name here, I used that string only for testing purposes. Just pushed a follow-up which fixes the CS issue and contains a more realistic message name.

@prolic
Copy link
Member

prolic commented Feb 5, 2016

@robertlemke My concern is not about if the message name is realistic or not, but that we need to make assumptions about it's name, that are not validated.

@robertlemke
Copy link
Contributor Author

@prolic hmm, is this related to this bugfix then? If so, then I probably still don't understand what you mean.

For me, this PR was just about fixing the missing brackets in the ternary operator.

@prolic
Copy link
Member

prolic commented Feb 5, 2016

No it's not related to your bugfix. I need to clarify with @codeliner, as i
think we've found one more bug.
Am 05.02.2016 11:56 schrieb "Robert Lemke" notifications@github.com:

@prolic https://github.com/prolic hmm, is this related to this bugfix
then? If so, then I probably still don't understand what you mean.

For me, this PR was just about fixing the missing brackets in the ternary
operator.


Reply to this email directly or view it on GitHub
#108 (comment).

@robertlemke
Copy link
Contributor Author

Allright ;-)

@codeliner
Copy link
Member

@robertlemke @prolic I agree. The current implementation could lead to unexpected errors but is a separate issue to solve. I think this PR can be merged, right?

prolic added a commit that referenced this pull request Feb 5, 2016
Resolve #107 - Correctly detect event name in OnEventStrategy
@prolic prolic merged commit 49cab74 into prooph:develop Feb 5, 2016
@prolic prolic added the bug label Feb 5, 2016
prolic added a commit that referenced this pull request Feb 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants