-
Notifications
You must be signed in to change notification settings - Fork 225
Make sure Launch Bar Manager sends event at a correct time #1486
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
base: main
Are you sure you want to change the base?
Changes from all commits
a052eb9
019d665
aa7a299
56e5ad4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -496,12 +496,12 @@ public void setActiveLaunchDescriptor(ILaunchDescriptor descriptor) throws CoreE | |
| doSetActiveLaunchDescriptor(descriptor); | ||
| // store in persistent storage | ||
| storeActiveDescriptor(activeLaunchDesc); | ||
| // Send notifications | ||
| fireActiveLaunchDescriptorChanged(); | ||
| // Set active target | ||
| syncActiveTarget(); | ||
| // Set active mode | ||
| syncActiveMode(); | ||
| // Send notifications | ||
|
betamaxbandit marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also changes the observable ordering of ILaunchBarListener notifications: target/mode notifications may now occur before the descriptor notification. I think that's reasonable for this fix, but because ILaunchBarListener is public API it would be useful for the regression test to make the intended semantics clear, in particular that listeners should rely on the manager state being consistent rather than on descriptor/target/mode notification ordering.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Mr. @betamaxbandit ,
Agree! This is what this change is aiming for. |
||
| fireActiveLaunchDescriptorChanged(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just moving this doesn't really solve the issue, the events for target & mode are still sent too early. This was why I suggested we create a new event that was for when any of them changed then we can just fire that once
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the comment, Mr. @Kummallinen About your suggestion, I did spend quite some time testing it out. Then I realized that existing events "activeLaunchTargetChanged" & "activeLaunchModeChanged" are sent at the same point as the newly added event. The only exception is "activeLauchDescriptorChanged", which is fired too early. From an event-handling perspective, there is no noticeable difference between the existing events and the new event. That's why I decided to go with the approach in this commit. --
Since "syncActiveTarget()" and "syncActiveMode()" is calling to "setActiveLaunchMode()" and "setActiveLaunchTarget()", respectively, the change events would still be fired too early even with the new event. -> Possible suggestion to fix for this would be creating internal method that does NOT fire event, Therefore, instead of trying to ensure that events are fired at desired time, this commit focuses on ensuring that all Launch Bar components are up to date when a change event is fired/caught, even if the triggering method has not yet finished executing.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi I am ok with this change. Also could you detail somewhere what other testing should be performed please? Is there a failing test at the moment that shows the problem obviously?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi Mr. @betamaxbandit ,
ATM, there is no test case that could detect this issue.
Thanks for the suggestion.
|
||
| } | ||
|
|
||
| private void doSetActiveLaunchDescriptor(ILaunchDescriptor descriptor) { | ||
|
|
||
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.
Can you remove InterruptedException?
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.
Sure, I removed them