Closed
Bug 890463
Opened 12 years ago
Closed 12 years ago
Follow up of Use MMIResult for get IMEI - default case
Categories
(Firefox OS Graveyard :: Gaia::Dialer, defect)
Tracking
(blocking-b2g:leo+, b2g18 fixed, b2g-v1.1hd fixed)
RESOLVED
FIXED
blocking-b2g | leo+ |
People
(Reporter: ferjm, Assigned: ferjm)
References
Details
(Whiteboard: [u=commsapps-user c=dialer p=0], [LeoVB+])
Attachments
(1 file, 1 obsolete file)
2.39 KB,
patch
|
etienne
:
review+
|
Details | Diff | Splinter Review |
As mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=888904#c6 we don't handle the default case properly.
Assignee | ||
Updated•12 years ago
|
blocking-b2g: --- → leo?
Assignee | ||
Comment 1•12 years ago
|
||
Assignee: nobody → ferjmoreno
Attachment #771579 -
Flags: review?(anthony)
Updated•12 years ago
|
Whiteboard: [u=commsapps-user c=dialer p=0]
Assignee | ||
Updated•12 years ago
|
Attachment #771579 -
Flags: review?(etienne)
![]() |
||
Updated•12 years ago
|
Flags: in-testsuite-
Comment 4•12 years ago
|
||
Comment on attachment 771579 [details] [diff] [review]
v1
Review of attachment 771579 [details] [diff] [review]:
-----------------------------------------------------------------
I'll let you decide, but it may be more readable to just have something like this and don't worry about calling LazyL10n.get each time (it's pretty cheap):
```
send: function mm_send(message) {
if (!this.ready) {
this.init();
}
LazyL10n.get((function localized(_) {
this._ = _;
if (this._conn) {
var request = this._pendingRequest = this._conn.sendMMI(message);
request.onsuccess = this.notifySuccess.bind(this);
request.onerror = this.notifyError.bind(this);
this.openUI();
}
}).bind(this));
},
```
Either way, we need to fix the double |_send()| call :)
::: apps/communications/dialer/js/mmi.js
@@ +53,5 @@
> + if (!self._) {
> + LazyL10n.get((function localized(_) {
> + self._ = _;
> + _send();
> + }).bind(self));
no need for the bind since you're referencing self and not this inside.
@@ +58,3 @@
> }
> +
> + _send();
aren't you missing an early return in the |if (!self._)|?
Looks like we're going to call |_send()| twice here...
::: apps/communications/dialer/test/unit/mmi_test.js
@@ +60,4 @@
>
> test('Check empty request result', function(done) {
> setTimeout(function() {
> + assert.equal(MmiManager._ui._messageReceived, undefined);
nit: chai has a assert.isUndefined()
Attachment #771579 -
Flags: review?(etienne)
Attachment #771579 -
Flags: review?(anthony)
Attachment #771579 -
Flags: review-
Assignee | ||
Comment 5•12 years ago
|
||
(In reply to Etienne Segonzac (:etienne) from comment #4)
>
> @@ +58,3 @@
> > }
> > +
> > + _send();
>
> aren't you missing an early return in the |if (!self._)|?
> Looks like we're going to call |_send()| twice here...
You are damn right! Thanks for noticing :). Fixing it.
Assignee | ||
Comment 6•12 years ago
|
||
Attachment #771579 -
Attachment is obsolete: true
Attachment #773842 -
Flags: review?(etienne)
Comment 7•12 years ago
|
||
Comment on attachment 773842 [details] [diff] [review]
v2
Review of attachment 773842 [details] [diff] [review]:
-----------------------------------------------------------------
Perfect, thanks!
Attachment #773842 -
Flags: review?(etienne) → review+
Assignee | ||
Comment 8•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 9•12 years ago
|
||
(In reply to Fernando Jiménez Moreno [:ferjm] (needinfo instead of CC, please) from comment #8)
> Thanks Etienne!
>
> https://github.com/ferjm/gaia/commit/5841c7d539f5d4d24f863a9ab3e23046dde96372
Do you have a commit ID for this commit on mozilla-b2g/gaia?
Assignee | ||
Comment 10•12 years ago
|
||
Isn't 5841c7d539f5d4d24f863a9ab3e23046dde96372 the commit ID?
Comment 11•12 years ago
|
||
Uplifted 5841c7d539f5d4d24f863a9ab3e23046dde96372 to:
v1-train: 7b79edb93d53f5fa956d3cbd0553d252c4e1c241
status-b2g18:
--- → fixed
Whiteboard: [u=commsapps-user c=dialer p=0] → [u=commsapps-user c=dialer p=0], [LeoVB+]
Comment 12•12 years ago
|
||
v1.1.0hd: 7b79edb93d53f5fa956d3cbd0553d252c4e1c241
status-b2g-v1.1hd:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•