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

Bug 404494

Summary: UI doesn't render if a message bundle referenced by extension command is missing
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: simon.kaegi
Version: 2.0   
Target Milestone: 5.0 RC1   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=428797
Whiteboard:

Description Mark Macdonald CLA 2013-03-27 16:30:22 EDT
A while ago I was testing an experimental Orion server on my local machine (at 'localhost:8080'). That server had some additional plugins that registered extensions of 'orion.page.link'. 

When I switched back to my normal Orion server, my browser cached the service extensions for the now-missing plugin (OK). When I loaded the Orion navigator, Orion tried to load the message bundles for the cached orion.page.link extensions (OK).

Because the plugin and its bundle do not exist, the bundle load fails:
> [14:43:43.429] Error: Load timeout for modules: i18n!myplugin/nls/messages myplugin/nls/messages git/nls/gitmessages orion/shell/nls/messages 
http://requirejs.org/docs/errors.html#timeout @ http://localhost:8080/requirejs/require.js:79

However, this completely breaks the left-hand pane of the navigator (where favorites and content creation normally appear). The Related pages menu is missing as well.

Whatever command framework code that loads message bundles for contributed extension commands needs to deal with a message bundle not loading and proceed anyway. One missing bundle should not take down major portions of the Orion UI.
Comment 1 Mark Macdonald CLA 2014-01-30 18:05:01 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=45642f9

The problem was in i18nUtil#getMessageBundle(name). It returns a promise which resolves when the bundle is loaded. But if the bundle 404s, the promise is just left hanging, which prevents the caller from detecting the error and recovering from it.

I fixed it so that the returned promise rejects when the bundle fails to load. Now when a contribution of any of the following types references a non-existent:NLS bundle, the failure is handed without breaking the whole UI.
- orion.page.link
- orion.page.link.category
- orion.page.link.related

I did not test the orion.(edit|navigate).command extensions, but if they're handled through the extensionCommands.js#createCommandOptions() mechanism, then they should pick up this failure tolerance for free too.