Closed
Bug 982479
Opened 11 years ago
Closed 11 years ago
InternalErrorWrongContentEvent when signing in for first time through DOM API
Categories
(Firefox OS Graveyard :: FxA, defect)
Firefox OS Graveyard
FxA
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: jedp, Assigned: spenrose)
References
Details
Attachments
(1 file)
STR:
Using some DOM API client (like the test app submitted in bug 929917 attachment 8389549 [details]):
- Invoke navigator.mozId.request()
- Go through UI steps (either to sign up or sign in, it doesn't matter)
Expected: onlogin() fires with assertion
Actual: onerror() fires with
{"error":"UI_ERROR","details":"InternalErrorWrongContentEvent"}
Further notes: You are actually signed into the device at this point. If you call request() for a second time, onlogin() will be fired with an assertion as expected.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → spenrose
Reporter | ||
Comment 1•11 years ago
|
||
If it helps, this error is emitted from b2g/components/FxAccountsUIGlue.js, so that might be a good place to start digging.
Assignee | ||
Comment 2•11 years ago
|
||
gaia: apps/system/js/fxa_manager.js doing this:
var event = new CustomEvent('mozFxAccountsRPContentEvent', msg) // msg is NEVER empty
window.dispatchEvent(event);
gecko: b2g/components/FxAccountsUIGlue.js is doing this:
_browser = Services.wm.getMostRecentWindow("navigator:browser");
content = this._browser.getContentWindow();
content.addEventListener("mozFxAccountsRPContentEvent", function(result) {
// result is an empty object
});
Going to learn about CustomEvent.
Assignee | ||
Comment 3•11 years ago
|
||
The fix is a one-liner. PR coming; I have to set up a Gaia fork.
diff --git a/apps/system/js/fxa_manager.js b/apps/system/js/fxa_manager.js
index 358fce6..a3718f1 100644
--- a/apps/system/js/fxa_manager.js
+++ b/apps/system/js/fxa_manager.js
@@ -116,7 +116,7 @@ var FxAccountsManager = {
},
_sendContentEvent: function fxa_mgmt_sendContentEvent(msg) {
- var event = new CustomEvent('mozFxAccountsRPContentEvent', msg);
+ var event = new CustomEvent('mozFxAccountsRPContentEvent', {detail: msg});
window.dispatchEvent(event);
},
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #8390174 -
Flags: review?(jparsons)
Reporter | ||
Comment 5•11 years ago
|
||
Beautiful. This fixes the problem I reported in Comment 0.
Merged!
Thanks, Sam,
j
Reporter | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•11 years ago
|
Attachment #8390174 -
Flags: review?(jparsons) → review+
Comment 6•11 years ago
|
||
Thanks for the fix Sam!
Just a friendly reminder for following bugs: make sure that we get a review from a system peer [1] and the commit message contains the bug number and the reviewer's name on it as described in [2], please :)
[1] https://wiki.mozilla.org/Modules/FirefoxOS#System
[2] https://developer.mozilla.org/en-US/Firefox_OS/Platform/Gaia/Hacking#Submitting_a_patch
Component: Identity → FxA
Product: Core → Firefox OS
You need to log in
before you can comment on or make changes to this bug.
Description
•