Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339759 - Sometimes reload required when first visiting orion.eclipse.org
Summary: Sometimes reload required when first visiting orion.eclipse.org
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P2 major (vote)
Target Milestone: 0.2   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 340612
Blocks:
  Show dependency tree
 
Reported: 2011-03-11 15:08 EST by John Arthorne CLA
Modified: 2011-09-01 11:41 EDT (History)
6 users (show)

See Also:


Attachments
patch for m6 (2.07 KB, patch)
2011-03-21 18:33 EDT, Mark Macdonald CLA
no flags Details | Diff
Patched compiled version of navigate-table.js (63.22 KB, text/x-js)
2011-03-22 17:13 EDT, Mark Macdonald CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-03-11 15:08:17 EST
Build: 0.2 M6

Several users reported that when first visiting a page on orion.eclipse.org, they get a "Fetching..." message forever. Hitting F5 to refresh then works as expected.

Mark and Libing reported that in the error case, fileClientPlugin.html isn't loaded. This smells like some kind of race condition in the client (perhaps trying to fetch contents before the file client has been loaded).
Comment 1 Ian Skerrett CLA 2011-03-14 15:08:56 EDT
I've have experienced this for M6.   I was using Chrome and I have been using M5.
Comment 2 Susan McCourt CLA 2011-03-15 16:09:16 EDT
JulianJ from IBM experienced this problem on both FF and Chrome in his first attempts to try Orion.   He just got "Transferring data from orion.eclipse.org..." in a the browser and then "Done" but the screen was blank.

On Chrome, shift/refresh fixed the problem.
On FF, he was never able to refresh his way out of the problem, so he stayed with Chrome.
Comment 3 Nathan Gervais CLA 2011-03-15 16:26:20 EDT
Shift-Reloading doesnt really seem like the greatest thing to have to tell people to do.

Could we use query keys on the javascript URLs to do some cache invalidation.

See -> http://html5boilerplate.com/docs/#Version-Control-with-Cachebusting
Comment 4 John Arthorne CLA 2011-03-15 17:14:11 EDT
It's not a caching problem. The problem seems to be that the file plugin isn't loading in time. It is likely some kind of race condition or timing problem in our plugin/service initialization. Mark reported that in the failure case, fileClientPlugin.html wasn't getting loaded.
Comment 5 Susan McCourt CLA 2011-03-18 18:50:59 EDT
Mark, can you start investigating this?  I talked to Boris about us trying to push a fix early in eclipsecon week since people are going to be running into this.  I can help, but figured you have a head start time-zone wise.
Comment 6 Mark Macdonald CLA 2011-03-21 17:08:27 EDT
The navigate-table glue code is not doing its initialization in the right order.

At creation time, PluginRegistry needs a storage object to populate itself from. Normally this is localStorage, but on first visit localStorage is empty until the default preferences have been fetched from the PreferencesService.

If we defer creation of the plugin registry until the preferences have been fetched, it fixes this.
Comment 7 Simon Kaegi CLA 2011-03-21 17:48:29 EDT
Nice job Mark.
I think the only fix we can do short-term is as you describe.

I created bug 340612 to look at maybe doing more in M7.
Comment 8 Mark Macdonald CLA 2011-03-21 18:33:05 EDT
Created attachment 191650 [details]
patch for m6

Here is a patch against M6 (v20110311-1121)

PluginRegistry is created inside a getPreferences().then() block that forces the default prefs to be loaded.

The FavoritesService initialization is also moved into the same block; this is because there seems to be an issue with getPreferences() that causes the favorites to receive the wrong data if it's called while the first getPreferences() request is still in progress (see Bug 340614). Moving it inside makes the requests serial and avoids that.
Comment 9 Mark Macdonald CLA 2011-03-22 17:13:32 EDT
Created attachment 191711 [details]
Patched compiled version of navigate-table.js

Here's the patch from Comment #8 applied to the compiled M6 version of navigate-table.js.
This file can be dropped into eclipse/plugins/org.eclipse.orion.client.core_0.2.0.v20110311-1121/static/js/compiled
Comment 10 John Arthorne CLA 2011-03-31 16:54:16 EDT
I have pushed Mark's fix to orion.eclipse.org. Mark, can you verify that it is fixed? I was never able to reliably reproduce this so don't have confidence that I can verify it. I just quickly tried on FF 4 and IE 8 and didn't have to refresh.

Once the fix is verified I will also push it to orionhub.org.
Comment 11 Mark Macdonald CLA 2011-04-01 10:14:26 EDT
(In reply to comment #10)
> Mark, can you verify that it is fixed? 

I can still reproduce the problem. I've tried reloading http://orion.eclipse.org/js/compiled/navigate-table.js but I don't see the changes from attachment 191711 [details] -- it looks like the same version of the file that was there before.
Comment 12 John Arthorne CLA 2011-04-25 17:44:45 EDT
We likely need to dust off this patch for M7 assuming there is no deeper structural change coming in bug 340612. I am wondering why in the patch only the favourites service is deferred until after the plugin registry is created. I imagine to be on the safe side, almost all the glue code needs to be deferred until the plugin registry is initialized. So the pattern would be:

 - create service registry
 - create preference service
 - wait for preference service to be initialized
 - create the plugin registry
 - Once plugin registry is loaded, do all the rest of the initialization work.

I noticed Boris just released this in navigate.table.js:

	var fileServices = serviceRegistry.getServiceReferences("IFileService");


This will be broken unless it happens *after* the plugin registry is successfully loaded (or already cached). There may be other examples where service lookups are occurring that would need to be deferred.
Comment 13 Susan McCourt CLA 2011-04-26 11:35:46 EDT
see also bug 334197.
Comment 14 Simon Kaegi CLA 2011-04-28 11:55:59 EDT
Fixed in HEAD.
We'll continue to improve and formalize this stuff in M8 in bug 334197.
Comment 15 Simon Kaegi CLA 2011-04-28 11:56:29 EDT
.