Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340614 - [client] Issue with concurrent calls to PreferencesService.getPreferences()
Summary: [client] Issue with concurrent calls to PreferencesService.getPreferences()
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Simon Kaegi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-21 18:18 EDT by Mark Macdonald CLA
Modified: 2011-09-01 11:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Macdonald CLA 2011-03-21 18:18:38 EDT
0.2M6

I have a scenario similar to this:

1. Client A does preferencesService.getPreferences("/window").then( ... )
2. Before A's promise is resolved, client B does preferenceService.getPreferences("/window/foo").then( ... ) 
3. Time passes
4. A's then() handler fires with the expected result: the /window node
5. B's then() handler fires with the wrong result: /window instead of /window/foo

This seems to be due to all Preferences objects sharing the same UserPreferencesProvider, which uses only 1 promise for all outstanding xhr calls. B gets the same promise as A, so it ends up with A's preference node.
Comment 1 Susan McCourt CLA 2011-04-06 19:50:59 EDT
I'm using preferences now to remember expanded state and selection state in the navigator.  I'm seeing some bizarre timing-related bugs that I believe are related to this problem.
Comment 2 Simon Kaegi CLA 2011-04-06 21:27:06 EDT
Sorry Susan.
I'll bump the priority and take a look tomorrow.
Comment 3 Susan McCourt CLA 2011-04-07 10:19:56 EDT
(In reply to comment #2)
> Sorry Susan.
> I'll bump the priority and take a look tomorrow.

I switched to sessionStorage as you suggested for UI state, so this is less an issue for me.  (But I think it'd be cool to look at it because it sounds like it could introduce some very subtle bugs.)
Comment 4 Simon Kaegi CLA 2011-06-08 11:44:29 EDT
Fixed in HEAD. John Reviewed.