-
Notifications
You must be signed in to change notification settings - Fork 40
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
Regular listeners shouldn't be called for paired response events #552
Conversation
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.
nice 👍🏻
swift format use isWilcard variable instead of func
One concern I have with this change is how response events are used in other places in the SDK. Currently, in configuration, we dispatch a response event when the config is updated. No specific listeners are listening for the "response" event in particular. But this is still a response event to a request event, so we want to tie them together by making it a response event. This is useful in Griffon mainly and debugging. With this change, it would appear that no other extension could actually listen for the response event coming from configuration, as no one is registered to be a response listener on the configuration request event. On second thought, I actually think the existing behavior may be desired. I think other listeners that match the type and source should be notified of this event. But response listeners should only be invoked when the corresponding response event comes through the EventHub and ensures it is only invoked once. @shalehaha thoughts? |
8752385
to
f74ab85
Compare
Another example I can give is that Griffon listens for Analytics response events to tie them to Analytics request events. With this change, Griffon wouldn't be able to hear the response events as those events would only be dispatched to the paired listeners and not to every listener registered for Analytics response events. |
In the past we used to only send a paired response event (with responseId) when there was a getter waiting for it and that was the only listener that should have receive this event, for other updates it should a generic, non-paired response event that will be broadcasted to all the listeners interested in the event. Did this behavior change in the case of configuration 3.0.0? |
Griffon uses wildcard listener so the response event will be visible to it. |
Codecov Report
@@ Coverage Diff @@
## dev-v3.0.1 #552 +/- ##
==============================================
+ Coverage 84.73% 84.73% +0.01%
==============================================
Files 100 100
Lines 4419 4427 +8
==============================================
+ Hits 3744 3751 +7
- Misses 675 676 +1 |
@nporter-adbe @shalehaha As discussed offline, this PR makes the regular vs paired response events behavior to be in line with the ACPCore logic. |
Fixes #551 and #557