Last Comment Bug 778027 - [Settings API] addObserver & onsettingchange quirks
: [Settings API] addObserver & onsettingchange quirks
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla17
Assigned To: Gregor Wagner [:gwagner]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-26 19:22 PDT by Tim Guan-tin Chien [:timdream] (please needinfo; OOO and on leave until July)
Modified: 2012-09-07 03:21 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
-


Attachments
patch (1.16 KB, patch)
2012-07-30 11:39 PDT, Gregor Wagner [:gwagner]
jonas: review+
Details | Diff | Review

Description Tim Guan-tin Chien [:timdream] (please needinfo; OOO and on leave until July) 2012-07-26 19:22:05 PDT
Test case 1: http://pastie.org/4340018

Expected: 

I/GeckoDump( 3172): ==== set
I/GeckoDump( 3172): ==== observer 1
I/GeckoDump( 3172): ==== observer 2


Actual: each observer callback is being fired twice

I/GeckoDump( 3172): ==== set
I/GeckoDump( 3172): ==== observer 1
I/GeckoDump( 3172): ==== observer 2
I/GeckoDump( 3172): ==== observer 1
I/GeckoDump( 3172): ==== observer 2

Test case 2: http://pastie.org/4340028

Expected: 

I/GeckoDump( 3253): ==== set
I/GeckoDump( 3253): ==== observer 1
I/GeckoDump( 3253): ==== observer 2

Actual: observer 1 does not fire, observer 2 is being called twice.

I/GeckoDump( 3253): ==== set
I/GeckoDump( 3253): ==== observer 2
I/GeckoDump( 3253): ==== observer 2
Comment 1 Tim Guan-tin Chien [:timdream] (please needinfo; OOO and on leave until July) 2012-07-26 21:19:46 PDT
Test case 3: http://pastie.org/4340633

Expected:

====foo.bar1
====foo1
====foo.bar
====foo

Actual:

====foo.bar
====foo
====foo.bar
====foo
Comment 2 Tim Guan-tin Chien [:timdream] (please needinfo; OOO and on leave until July) 2012-07-26 21:27:02 PDT
The way to run these test case on the phone would be replace system/index.html with the content, and start up B2G.

This issue is track on Gaia here
https://github.com/mozilla-b2g/gaia/issues/2891
Comment 3 Tim Guan-tin Chien [:timdream] (please needinfo; OOO and on leave until July) 2012-07-27 05:39:21 PDT
Test case 4: this runs as expected -- I am reverting Gaia back to this pattern.

http://pastie.org/4342263
Comment 4 Gregor Wagner [:gwagner] 2012-07-30 11:39:22 PDT
Created attachment 647232 [details] [diff] [review]
patch

my mistake!
Comment 5 Gregor Wagner [:gwagner] 2012-07-30 13:54:28 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/bbb183d33d46

To put multiple values with a single set isn't implemented. You should use a single lock and multiple set functions instead.
Comment 6 Ed Morley [:emorley] 2012-07-31 06:12:17 PDT
https://hg.mozilla.org/mozilla-central/rev/bbb183d33d46
Comment 7 Andrew Overholt [:overholt] 2012-08-08 10:30:49 PDT
We wouldn't block on this if it were to regress.
Comment 8 Gene Lian [:gene] (I already quit Mozilla) 2012-09-07 03:21:23 PDT
Is Bug 779381 still an issue after this one is solved?

Note You need to log in before you can comment on or make changes to this bug.