Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 389783

Summary: menu item order changes dynamically
Product: [ECD] Orion Reporter: Rafael Chaves <eclipse>
Component: ClientAssignee: Susan McCourt <susan>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 1.0 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
plugin showing the issue
none
plugin showing the issue (HTML) none

Description Rafael Chaves CLA 2012-09-18 02:18:47 EDT
Orion 1.0m1

My plugin contributes navigator commands. The order my contributed actions appears is not stable, potentially changing between two openings of the actions menu.

See demo at: http://www.youtube.com/watch?feature=player_detailpage&v=dbqHme6eKgw#t=50s
Comment 1 Rafael Chaves CLA 2012-09-18 02:20:35 EDT
Notice how the Launch/Deploy actions appear at the bottom of the menu at first, and then in the middle of menu later.
Comment 2 Susan McCourt CLA 2012-09-18 11:17:29 EDT
Probably the code that is iterating the contributions is assigning the same "position" in the command framework which would leave the order to the js sort routine.  That's no good.  Minimally we should be assigning unique positions as we iterate service extensions to keep things stable.  I'll see if any particular sort order above the service contribution order makes sense.  

I'll also check to see if the iteration of service extensions is expected to be repeatable.  If it is not, then some kind of sort would be necessary, which would also make things more stable when a new plugin with a command contribution was loaded.
Comment 3 Susan McCourt CLA 2012-09-24 14:57:33 EDT
see also bug 390221.  I don't think it would fix this issue, but it could change the behavior again.  The way service extensions are traversed will likely change again.
Comment 4 Susan McCourt CLA 2012-10-02 16:02:19 EDT
Rafael, can you point me to a link for your plugin that exhibits the problem? 
I can't get this to happen running the Orion commands plus "sampleCommandsPlugin" so I need reproducible steps....
Comment 5 Rafael Chaves CLA 2012-10-02 23:57:25 EDT
Created attachment 221820 [details]
plugin showing the issue
Comment 6 Rafael Chaves CLA 2012-10-02 23:57:52 EDT
Created attachment 221821 [details]
plugin showing the issue (HTML)
Comment 7 Rafael Chaves CLA 2012-10-03 00:00:55 EDT
Susan, I attached the plugin files here because they haven't been released yet. 

I don't remember seeing that behavior again, and only decided it was not just me seeing things because I had the video to prove it.
Comment 8 Susan McCourt CLA 2012-10-03 11:02:56 EDT
(In reply to comment #7)
> Susan, I attached the plugin files here because they haven't been released
> yet. 
> 
> I don't remember seeing that behavior again, and only decided it was not
> just me seeing things because I had the video to prove it.

Thanks for the files.
(I used the new "import from HTTP" feature to grab them directly from this bug! Just had to rename the files, update the script pointer...)
 
yes, I saw the video and was very surprised to see the behavior.  
Of course I can't reproduce it.  I created several different mdd.properties files in different folders but the order is stable.  I looked at the code to see if comment #2 was true, and it was not. 

So I think I'm going to close this as invalid (even though you have video proof!) until we can come up with a repeatable case.  

Please reopen if you see this again on later builds.