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

RESOLVED INVALID

Status

Firefox OS
Gaia::System
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: nhirata, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

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)

Comment 3

5 years ago
(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

Comment 4

5 years ago
Slightly off-topic:

- On my device (Unagi, latest update), Add notification doesn't work (https://github.com/robnyman/Firefox-OS-Boilerplate-App/blob/gh-pages/js/webapp.js#L205, https://github.com/robnyman/Firefox-OS-Boilerplate-App/blob/gh-pages/manifest.webapp#L20)
- Add Alarm doesn't work either (https://github.com/robnyman/Firefox-OS-Boilerplate-App/blob/gh-pages/js/webapp.js#L252, https://github.com/robnyman/Firefox-OS-Boilerplate-App/blob/gh-pages/manifest.webapp#L23)
- Also, any idea why Share URL doesn't fill in the value in the Browser?
https://github.com/robnyman/Firefox-OS-Boilerplate-App/blob/gh-pages/js/webapp.js#L163
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
Last Resolved: 5 years ago
Flags: needinfo?(fabrice)
Resolution: --- → INVALID
Thanks for the explanation, jsmith and robert.  Should the contacts app be named contacts, not communications?

Comment 7

5 years ago
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.