Closed Bug 851335 Opened 11 years ago Closed 11 years ago

mozactivity with mailto: url gives an option of opening with "Communications" and SMS

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: nhirata, Unassigned)

Details

## Environment :
Gecko  http://hg.mozilla.org/releases/mozilla-b2g18/rev/dc3add076016
Gaia   1e1c8c0ff2bc7f252fbe95016f108e38ece691a9
BuildID 20130314070204
Version 18.0
Unagi
  
## Repro :
1. in the browser go to http://robnyman.github.com/Firefox-OS-Boilerplate-App/
2. select compose

## Expected : Email only

## Actual : Email, SMS and Communications (which is actually contacts)

## Note :
    var composeEmail = document.querySelector("#compose-email");
    if (composeEmail) { 
        composeEmail.onclick = function () {
            var createEmail = new MozActivity({
                name: "new", // Possibly compose-mail in future versions
                data: {
                    url: "mailto:someone@example.com?cc=someone_else@example.com&subject=This%20is%20the%20subject&body=This%20is%20the%20body"
                }
            });
        }
For communications:

    "new": {
      "filters": {
        "type": "webcontacts/contact"
      },
      "disposition": "inline",
      "href": "/contacts/index.html?new",
      "returnValue": true
    },

For SMS:

    "new": {
      "filters": {
        "type": "websms/sms",
        "number": { "regexp":"/^[\\w\\s+#*().-]{0,50}$/" }
       },
      "disposition": "window"
    }

For Email:

    "new": {
      "filters": {
        "type": "mail"
      },
      "disposition": "window"
    },
This looks like a bug in the app, not a bug in our system.

The MozActivity request being made isn't specifying a filter, so when the activity fires, we search the activity registry for any activities that have new in it with any possible filter. As a result, we end up finding the three apps cited here - communications, SMS, and Email.

Fabrice - Can you confirm?
Flags: needinfo?(fabrice)
(In reply to Jason Smith [:jsmith] from comment #2)
> This looks like a bug in the app, not a bug in our system.
> 
> The MozActivity request being made isn't specifying a filter, so when the
> activity fires, we search the activity registry for any activities that have
> new in it with any possible filter. As a result, we end up finding the three
> apps cited here - communications, SMS, and Email.
> 
> Fabrice - Can you confirm?

Jason is absolutely right, Firefox OS behaves as expected. When I added that, there was no clear resource what to specify to trigger the right apps.

I've committed and pushed a fix:

https://github.com/robnyman/Firefox-OS-Boilerplate-App/commit/3b0b15a6d55b420e3cd29ba486c1a214106d83a0
Okay, so Robert confirmed my claim then. I'll close this bug as invalid then more to indicate this isn't a bug in our system.

I'll follow up with you Robert offline on comment 4.
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(fabrice)
Resolution: --- → INVALID
Thanks for the explanation, jsmith and robert.  Should the contacts app be named contacts, not communications?
Perhaps. Seems more consistent to me, at least.
(In reply to Naoki Hirata :nhirata (please use needinfo instead of cc) from comment #6)
> Thanks for the explanation, jsmith and robert.  Should the contacts app be
> named contacts, not communications?

Yeah. File a new bug for that.

The root cause of the problem there is that the activities manifest item is specified in the root, not on a per entry point basis.
You need to log in before you can comment on or make changes to this bug.