[Settings API] addObserver & onsettingchange quirks

RESOLVED FIXED in mozilla17

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: timdream, Assigned: gwagner)

Tracking

Trunk
mozilla17
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(blocking-basecamp:-)

Details

Attachments

(1 attachment)

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
(Assignee)

Updated

5 years ago
Assignee: nobody → anygregor
blocking-basecamp: --- → ?
Test case 3: http://pastie.org/4340633

Expected:

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

Actual:

====foo.bar
====foo
====foo.bar
====foo
blocking-basecamp: ? → ---
blocking-basecamp: --- → ?
Summary: [Settings API] addObserver quirks → [Settings API] addObserver & onsettingchange quirks
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
Test case 4: this runs as expected -- I am reverting Gaia back to this pattern.

http://pastie.org/4342263
(Assignee)

Comment 4

5 years ago
Created attachment 647232 [details] [diff] [review]
patch

my mistake!
Attachment #647232 - Flags: review?(jonas)
Attachment #647232 - Flags: review?(jonas) → review+
(Assignee)

Comment 5

5 years ago
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

5 years ago
https://hg.mozilla.org/mozilla-central/rev/bbb183d33d46
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
We wouldn't block on this if it were to regress.
blocking-basecamp: ? → -
Is Bug 779381 still an issue after this one is solved?
You need to log in before you can comment on or make changes to this bug.