Closed Bug 1142591 Opened 5 years ago Closed 5 years ago

Wrong number of contacts imported and merged shown in the banner when importing the contacts from a multiple vcard

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(b2g-v2.2 unaffected, b2g-v2.5 verified, b2g-master verified)

VERIFIED FIXED
2.2 S9 (3apr)
Tracking Status
b2g-v2.2 --- unaffected
b2g-v2.5 --- verified
b2g-master --- verified

People

(Reporter: oteo, Assigned: hola)

Details

Attachments

(2 files)

Pre-requisite: 
1)Share a vcard with multiple contacts with a FxOS user via E-mail application or Messaging application.
2)The Agenda in the FxOS device is empty (to check easily the results)

STR:
1. (e.g.)E-mail is received in FxOS device with a vcard with 12 contacts
2. Click on the received vcard attachment to download the corresponding .vcf file
3. After completing the Download, click on the "eye" icon in the mail to preview the vcard. An "Import" screen is shown showing all the contacts included in the vcard.
4.Click on the "Import" button 
Go to step 3 and repeat steps 3 and 4 again


Actual Result:
4.a) The contacts included in the vcard are pefectly imported in the Agenda (the 12 contacts) but the banner shown at the botton of the Import screen is wrong, it says: "Imported 10 contacts. No duplicated contacts merged"
4.b) The 12 contacts imported again are merged as they are duplicated of the already included in the Agenda, so the Agenda continue having 12 contacts that is ok but the banner is wrong: "Imported 8 contacts. 8 contacts merged"

Expected Result: 
4.a) The banner should show "Imported 12 contacts. No duplicated contacts merged"
4.b) The banner should show "Imported 12 contacts. 12 contacts merged"

Environmental Variables: 
Device: Flame Master
Build ID: 20150312111245    
Gaia: 4f6a3ff
Gecko: fb7ccb2
Platform Version: 39.0a1 (Master)
Firmware Version: v18D
Assignee: nobody → hola
Status: NEW → ASSIGNED
Comment on attachment 8576790 [details] [review]
[gaia] ADLR-es:incorrect-num-imported > mozilla-b2g:master

It was produced by a race condition. I created a new variable to track the number of contacts processed. Without this patch, the activity was closed when the contact with the last index was processed, but since it was being done asynchronously, we couldn't guarantee that the last contact would be processed in the last position.
Attachment #8576790 - Flags: review?(jmcf)
I think we need a test (integration test preferably)
Attachment #8576790 - Flags: review?(jmcf)
Comment on attachment 8576790 [details] [review]
[gaia] ADLR-es:incorrect-num-imported > mozilla-b2g:master

Small check for the text in the status message added in the integration test.
Attachment #8576790 - Flags: review?(jmcf)
Comment on attachment 8576790 [details] [review]
[gaia] ADLR-es:incorrect-num-imported > mozilla-b2g:master

thanks Adrian
Attachment #8576790 - Flags: review?(jmcf) → review+
Keywords: checkin-needed
Keywords: checkin-needed
https://github.com/mozilla-b2g/gaia/pull/28848

Autolander could not land the pull request due to not having collaborator rights. This is possibly due to a tree closure. Please check the tree status and request checkin again once the tree is open.
Keywords: checkin-needed
https://github.com/mozilla-b2g/gaia/pull/28848

Autolander could not land the pull request due to not having collaborator rights. This is possibly due to a tree closure. Please check the tree status and request checkin again once the tree is open.
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S9 (3apr)
Thanks a lot for your work Adrian!
I've tested the patch with latest master version and it is working as expected :)

Environmental Variables: 
Device: Flame Master
Build ID: 20150325071251    
Gaia: 3970bcf
Gecko: a2b428e
Platform Version: 39.0a1 (Master)
Firmware Version: v18D
This bug has been verified as pass on latest build of Flame KK v2.5&master 512mb by the STR in comment 0.
Actual results:
4.a) The banner shows "Imported 12 contacts. No duplicated contacts merged".
4.b) The banner shows "Imported 12 contacts. 12 contacts merged".
See attachment: FlameKK_v2.5.3gp.
Reproduce rate: 0/10

Device: Flame KK master 512mb (pass)
Build ID               20151228150204
Gaia Revision          15a00047c0868cc8f4c8ec4af253b82ac54d70dd
Gaia Date              2015-12-26 05:30:48
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/7c83da46ea740bc14028aca9f9a662f062de5586
Gecko Version          46.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20151228.185050
Firmware Date          Mon Dec 28 18:51:03 EST 2015
Fireware Version       v18D v4
Bootloader             L1TC000118D0

Device: Flame KK v2.5 512mb (pass)
Build ID               20151223152613
Gaia Revision          8db2cdd9eb9b42932c4dfc86d109b3e46c220809
Gaia Date              2015-12-23 13:30:29
Gecko Revision         http://hg.mozilla.org/releases/mozilla-b2g44_v2_5/rev/6fac3536a96a87185a6415d6ae2c36a85612e863
Gecko Version          44.0
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.worker.20151223.143931
Firmware Date          Wed Dec 23 14:39:41 UTC 2015
Fireware Version       v18D v4
Bootloader             L1TC000118D0
Status: RESOLVED → VERIFIED
QA Whiteboard: [MGSEI-Triage+]
You need to log in before you can comment on or make changes to this bug.