Closed
Bug 828076
Opened 11 years ago
Closed 11 years ago
Trusty UI should notify caller when it has been closed by user action (canceled)
Categories
(Firefox OS Graveyard :: Gaia::System, defect)
Firefox OS Graveyard
Gaia::System
Tracking
(blocking-basecamp:+)
People
(Reporter: jedp, Assigned: jedp)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
The Trusty UI does not currently notify the application that has opened it when it is closed by user action (i.e., canceled); it should. I think an onCancel callback as the optional last argument to the open() method would be the cleanest way to provide this functionality: It is simple to understand and use, and it doesn't require any change to existing code that calls the Trusty UI now.
Comment 1•11 years ago
|
||
Strangely enough this problem does not reproduce with mozPay after we fix it's equivalent bug on this problem.
Component: General → Gaia::System
Comment 2•11 years ago
|
||
Since the work week is *fix all the blockers!* policy I'm ccing a few people who might steal this bug while Jed sleeps tonight to fix this, given that it blocks a blocker.
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Jason Smith [:jsmith] from comment #2) > Since the work week is *fix all the blockers!* policy I'm ccing a few people > who might steal this bug while Jed sleeps tonight to fix this, given that it > blocks a blocker. Thanks, Jason :) Yes, I am just hitting the sack. But I think the fix for this could look like this: https://github.com/jedp/gaia/commit/be7ffd505ab45c4d6865ffd338ad67fcb813b1e1 What do people think? If it seems ok, I'll submit a PR first thing in the morning. Otherwise, please feel free to take it and improve. Thanks! Cheers, j
Comment 4•11 years ago
|
||
Sorry, I missed Bug 823751. We already have a notification about a closed trusted UI at https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/trusted_ui.js#L132 which is handled, in the case of the mozPay implementation, at https://mxr.mozilla.org/mozilla-central/source/b2g/components/PaymentGlue.js#139. We might need the same handler for the identity side. For the case of mozPay, the application gets the notification of a closed trusted UI via the 'onerror' event that it is fired over the 'DOMRequest' returned by the 'mozPay()' call. Yours sound like a good solution for the Gaia side, since the caller app would be notified about the trusted UI being closed, but closing the trusted UI might also require triggering some cleanup for the chrome implementation that triggered the creation of the trusted UI at first, so we might still need this content event sent back to the chrome implementation.
Comment 5•11 years ago
|
||
Btw - bug 828182 just got filed that sounds related to this bug. Are they related? Should we do one bug and not the other?
Comment 6•11 years ago
|
||
Already replied via IRC, bug 828182 is independent from this one.
Assignee | ||
Comment 7•11 years ago
|
||
Thank you for mentioning the chrome events - they are very important and should be emitted separately for each caller within the destroy loop (here: https://github.com/mozilla-b2g/gaia/blob/master/apps/system/js/trusted_ui.js#L237)
Assignee | ||
Comment 8•11 years ago
|
||
Oh wait, actually that already happens: _destroyDialog() calls close() for each, and close() calls _closeTopDialog(), which sends the error message. But this means that the errorMsg is sent whenever TrustedUIManager.close() is called, which is semantically confusing to me. Having spoken with Fernando on IRC, we've agreed that the errorMsg should be emitted from the _destroyDialog loop, and not _closeTopDialog. This means that the errorMsg will not be emitted when TrustyUIManager.close() is called in payment.js, which he says is ok.
Assignee | ||
Comment 9•11 years ago
|
||
Thanks again for talking this over with me on IRC.
Attachment #700012 -
Flags: review?(ferjmoreno)
Attachment #700012 -
Flags: review?(ferjmoreno) → review+
Comment 10•11 years ago
|
||
https://github.com/mozilla-b2g/gaia/commit/f12824e075f7da55ed2fe4abdf98ba283387b4cb
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Whiteboard: [qa-]
Updated•11 years ago
|
Target Milestone: --- → B2G C4 (2jan on)
You need to log in
before you can comment on or make changes to this bug.
Description
•