Closed Bug 1087402 Opened 10 years ago Closed 10 years ago

[contacts] Integration tests for bug #974589 (follow up)

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.1 S8 (7Nov)

People

(Reporter: hola, Assigned: hola)

References

Details

(Keywords: verifyme, Whiteboard: [p=3])

Attachments

(1 file)

(deleted), text/x-github-pull-request
jmcf
: review+
Details
+++ This bug was initially created as a clone of Bug #974589 +++

In Bug 887663 (receive contacts via bluetooth), "text/vcard" was added to MimeMapper.  The e-mail app uses/introduced MimeMapper to know what MIME types have "open" web activities associated with them (as done in gallery/video/music).  The idea is that if there is an "open" activity, we can download the attachment and expose a "View" button in the e-mail UI which then triggers an "open" activity when pressed.  (Our choice of names for activities is obviously not great in general :)

Looking at the comments in mime_mapper.js, I can see that that the comments really are not sufficiently clear about the implications of adding a MIME type to the entries there.  There are hints if you already know what's going on, but too much of a light touch was used.

The implications of not exposing the open activity are that a user will be able to download a vcard in the e-mail app but not be able to view it because there is no webactivity available.

The e-mail app currently generates a WebActivity like this:
          var activity = new MozActivity({
            name: 'open',
            data: {
              type: mappedType,
              blob: blob
            }
          });
https://github.com/mozilla-b2g/gaia/blob/master/apps/email/js/cards/message_reader.js#L612
(In the future a filename will be passed in the data too for consistency with what gallery does, although the blob in question is actually a File and so does have a "name" on it.)

The logic in contacts/js/activities.js will need to be updated slightly since "open" currently is used only to "view-contact-details" using a mozContacts id and a made-up MIME type.  It can pivot on the MIME type or presence of a blob?  Once it does that, it looks like importContactFromFile(activity) will work directly.


I'm requesting blocking 1.3 to get initial feedback on whether this is a fix that would be desired on 1.3.  We already shipped v1.2 with this and vCards are small files, so it's not the end of the world if we don't uplift it.  The fix does look to be trivial.

I'll file a separate bug and provide a fix for mime_mapper.js and its comments.  (Noting that when e-mail integrates with the download manager, which could happen in 1.4 if partners provide the engineering, this could become slightly moot.  Or at least it will then be the download manager who is being betrayed by mime_mapper.js instead :)
Attached file Pull request #25415 (deleted) —
Missing tests for previous bug.
Attachment #8510407 - Flags: review?(jmcf)
Target Milestone: --- → 2.1 S8 (7Nov)
Comment on attachment 8510407 [details]
Pull request #25415

please see the comments on GH
Attachment #8510407 - Flags: review?(jmcf) → review-
Assignee: nobody → hola
Whiteboard: [p=6] → [p=3]
Comment on attachment 8510407 [details]
Pull request #25415

The test is really simple now. I didn't know I could pass parameters to a function executed with client.executeScript but now the code solves the problems you described in your comments.
Attachment #8510407 - Flags: review- → review?(jmcf)
Comment on attachment 8510407 [details]
Pull request #25415

cancelling review as we need to ensure that the fields are correctly filled in the contact edit form
Attachment #8510407 - Flags: review?(jmcf)
Comment on attachment 8510407 [details]
Pull request #25415

Now we check fields against expected values.
Attachment #8510407 - Flags: review?(jmcf)
Comment on attachment 8510407 [details]
Pull request #25415

please address the comments on GH

thanks
Attachment #8510407 - Flags: review?(jmcf) → review+
https://github.com/mozilla-b2g/gaia/commit/466572d27523b96bd2e744472bddba6a737e4787
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Blocks: 1134990
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: