Cannot open compose message view on b2g-desktop

RESOLVED WORKSFORME

Status

Firefox OS
Gaia::SMS
RESOLVED WORKSFORME
5 years ago
4 years ago

People

(Reporter: yxl, Assigned: yxl)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

With b2g-destop on Ubuntu, I cannot open the compose new message view and got the following errors from js console:

Error: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMMozMobileMessageManager.getSegmentInfoForText]
Source File: app://sms.gaiamobile.org/js/thread_ui.js
Line: 638
Created attachment 796436 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/11798

Pointer to Github pull-request
Comment on attachment 796436 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/11798

Hi Julien, could you help to review the patch?
Attachment #796436 - Flags: review?(felash)
(Assignee)

Updated

5 years ago
Assignee: nobody → xyuan
Status: NEW → ASSIGNED
We should rather fix the underlying issue.

FYI we're currently making getSegmentInfoForText asynchronous in bug 903403. It will return a DOMRequest, therefore errors should trigger onerror instead of throwing like this. And therefore you won't have this problem anymore.

Gene, any idea why we get a failure in b2g-desktop ?
Flags: needinfo?(gene.lian)
Attachment #796436 - Flags: review?(felash)
I believe it's stopped by [1]. Currently, we only support SMS functions for Gonk and Android platforms (Android is not working well right now but it's another issue).

IMO, the onerror should only work for returning errors when processing API codes, instead of reflecting whether an API is available on a certain platform.

I'm wondering why do you want to make a desktop version work? Even if you can work around to bypass getSegmentInfoForText(), you can still not call send(...) to send a real message.

I'm curious about how the current Gaia codes handles the send on the desktop. It seems we're using desktop_sms_mock.js to simulate dummy behaviour to send SMS instead of calling the API. Right? We should do the same thing for getSegmentInfoForText(). Catching exception also looks OK to me (what the current patch does).

[1] https://hg.mozilla.org/mozilla-central/file/dc7b76fcf7e4/dom/mobilemessage/src/fallback/SmsService.cpp#l25
Flags: needinfo?(gene.lian)
On the desktop, we don't have the API nor the function getSegmentInfoForText and therefore we just return early in this function.

Maybe we should disable the API on b2g-desktop so that it would load dummy data like on the desktop ?
Oh! You're saying b2g-desktop not desktop. Sorry I misunderstood. Then, it's not stopped by the check mentioned at comment #4. I'll check it out by building a b2g-destop version.
Flags: needinfo?(gene.lian)
The bug has been fixed on the lastest mc and gaia master.
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: needinfo?(gene.lian)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.