Closed Bug 942010 Opened 11 years ago Closed 11 years ago

The test_add_photo_to_contact.py gets Duplicates Found screen

Categories

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

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.3+, b2g-v1.3 fixed)

RESOLVED FIXED
1.3 C1/1.4 S1(20dec)
blocking-b2g 1.3+
Tracking Status
b2g-v1.3 --- fixed

People

(Reporter: askeing, Assigned: gtorodelvalle)

References

Details

(Keywords: dataloss, regression, reproducible, Whiteboard: [xfail] burirun1.3-1)

Attachments

(6 files)

Attached image Duplicates Found Screen
The test_add_photo_to_contact.TestContacts failed because the unexpected "Duplicates Found" screen.
The test will insert MockContact by Javascript, see detail below.

### ENV
Buri
Base Img: V1.2_US_20131115.cfg
Gaia:     71063dd91bc8cbb15ba335236ed67a1c5058bd58
Gecko:    http://hg.mozilla.org/mozilla-central/rev/cf378dddfac8
BuildID   20131121040202
Version   28.0a1

### STR
run test_add_photo_to_contact.py by gaia-ui-tests.

1. it will insert contact by Javascript below:
file: tests/python/gaia-ui-tests/gaiatest/atoms/gaia_data_layer.js
==================================================================
  insertContact: function(aContact) {
    SpecialPowers.addPermission('contacts-create', true, document);
    var contact = new mozContact(aContact);
    var req = window.navigator.mozContacts.save(contact);
    req.onsuccess = function () {
      console.log('success saving contact');
      SpecialPowers.removePermission('contacts-create', document);
      marionetteScriptFinished(true);
    };
    req.onerror = function () {
      console.error('error saving contact', req.error.name);
      SpecialPowers.removePermission('contacts-create', document);
      marionetteScriptFinished(false);
    };
  },

2. launch Contacts app.
3. edit the contact, add the photo.
4. tap update button.

### Expect Result
the contact can be updated with new photo.

### Actual Result
there is a Duplicates Found page on screen.
Attached file DuplicatesFound.log
Blocks: 942012
Isn't this a duplicate of bug 934537?
Buri
Base Img: V1.2_US_20131115.cfg
Gaia:     71063dd91bc8cbb15ba335236ed67a1c5058bd58
Gecko:    http://hg.mozilla.org/mozilla-central/rev/cf378dddfac8
BuildID   20131121040202
Version   28.0a1
=> Cannot manually reproduce bug 934537.
   Can reproduce by gaiatest (3/3).
Base Img: V1.2_US_20131115.cfg
Gaia:     67866e82379e751646aa5f0fd6a7a4268e9529c1
Gecko:    http://hg.mozilla.org/mozilla-central/rev/597287004ff5
BuildID   20131120062258
Version   28.0a1
=> Cannot manually reproduce bug 934537.
   Can reproduce by gaiatest (2/3).
Gaia:     5c2929cd15ac020f85026030387aed9eb322362d
Gecko:    http://hg.mozilla.org/mozilla-central/rev/770de5942471
BuildID   20131105040208
Version   28.0a1
=> Can manually reproduce bug 934537.

It seems like not the duplicate of bug 934537
I don't think the above analysis makes sense - bug 934537 is currently existing, so it should reproduce the current build. I originally flagged down bug 934537 as the xfailed bug to track the duplicates found issue. I'm going to dupe this because I think the STR & actual result are pretty much the same root cause.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Buri
Gaia:     d4b9a3d271f0451b4d903a03c2b931b8cc092041
Gecko:    http://hg.mozilla.org/mozilla-central/rev/6ecf0c4dfcbe
BuildID   20131127040203
Version   28.0a1
ro.build.version.incremental=eng.archermind.20131114.105818


I still can reproduce (both 20131126052050 and 20131127040203 build) by gaia-ui-tests on my PC and TWCI with different Buri.
$ gaiatest --address=localhost:2828 --testvars=testvars.json --restart gaiatest/tests/functional/contacts/test_add_photo_to_contact.py
But I cannot reproduce manually.

IMO, manually operate the Contacts app is fine (Bug 934537), however the Javascript WebAPI is broken (Bug 942010).
Reopening then for tracking the failure. Moving over to UI Tests first for diagnosis. Once we figure out the root cause, we can move it over to the appropriate bugzilla component.

Can you be more specific about what is failing in the WebAPI? I'm assuming you are referring to the contacts API, right?
Component: Gaia::Contacts → Gaia::UI Tests
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
I can replicate this manually on:
Gaia:     d4b9a3d271f0451b4d903a03c2b931b8cc092041
Gecko:    http://hg.mozilla.org/mozilla-central/rev/6ecf0c4dfcbe
BuildID   20131127040203
Version   28.0a1


If it's not reproducing the first time give it a second one.

Keep in mind you have to have a picture on the SD card
Complete manual STR in https://bugzilla.mozilla.org/show_bug.cgi?id=934537#c33.
blocking-b2g: --- → 1.3?
Component: Gaia::UI Tests → Gaia::Contacts
Whiteboard: [xfail]
I got it reproduced manually using the reference workload.
QA Contact: mvaughan
This issue started to reproduce on the 11/01/13 1.3 build.

- Works -
Environmental Variables:
Device: Buri v1.3 COM RIL
BuildID: 20131031040201
Gaia: 412fd463bcb81f0e8bebf6d32500d0c02712748d
Gecko: f0d363d72753
Version: 28.0a1
Firmware Version: 20131115
RIL Version: 01.02.00.019.082

- Broken -
Environmental Variables:
Device: Buri v1.3 COM RIL
BuildID: 20131101040203
Gaia: ccdf357ea150fc7d8b8a4b74c7adf31e7a57e465
Gecko: abe6790a5dd8
Version: 28.0a1
Firmware Version: 20131115
RIL Version: 01.02.00.019.096
Might be a regression from bug 898337 potentially, maybe bug 929652.

Julien - What do you think?
Flags: needinfo?(felash)
That's what we already thought about in bug 934537 but since we don't search by "name" in the deduplication code I fail to see how this could happen.

That said this seems highly probable that this revealed this issue, and I'd like that our Contacts peers have a look at this.

Note: Bug 934537 was a blocker because when it's happening and the user accepts the dedup, the contact is deleted. I'm quite sure this is the same bug here, and that we should not have closed bug 934537 and dupe this one there instead, but hey, let's keep it like this now :)

I reproduce this very easily with several STR.

Here is the simplest one:
* add a contact, fill in given name and family name, save
* edit it, fill it in company name (works also if you add a photo instead), save
=> duplicate window

In one case the "merge" button didn't work and I got this error in logcat:

  GeckoConsole: [JavaScript Error: "TypeError: messages[type] is undefined" {file: "app://communications.gaiamobile.org/contact/gaia_build_matching_contacts.js" line: 151}]

(I tried to reproduce it with an unoptimized file to get a better location, but I couldn't, sorry)

In all other cases the "merge" button worked and the contact was deleted, and I got this error in logcat:

  GeckoConsole: [JavaScript Error: "Return value is not an object."]

Not sure this is related though.

German, could you please have a look at this? Tell me if you can't reproduce, because I can reproduce very easily and 100% of the time with this STR.
Flags: needinfo?(felash) → needinfo?(gtorodelvalle)
As Ayman said in Bug 934537, we never should have the same contact as a dupe proposal.
Blocks: 925852
Hey! Sorry I got this bug mislayed :-(

Julien, sadly I am not able to reproduce the bug following your STR on my Unagi using Gecko-18c6a00.Gaia-f615ae7 (v1.2) :-(

Using latest builds and Gaia master, I am not able to reproduce it either.

Sorry for the delay in my reply but can you reproduce the bug yet or has it be magically solved? Thanks! I could share the build I am using with you via Dropbox in case you want to try it :)
Flags: needinfo?(gtorodelvalle) → needinfo?(felash)
I still see it with latest gecko/gaia (on central/master) with the exact same STR I was giving in comment 17.
Flags: needinfo?(felash)
Ups, my bad :-O I just reproduced it using Gecko-f72fdda and latest master, probably I mixed the versions in my previous tests ;-9

BTW, I only get the:
E/GeckoConsole(  752): [JavaScript Error: "Return value is not an object."]
error when I click on the button to delete the company (at least in my case) when there was some previously set company.

Taking a look at the source of the issue right now ;-) I'll keep you posted!
Assignee: nobody → gtorodelvalle
Attached file 14507.html
Attachment #8344720 - Flags: review?(jmcf)
Comment on attachment 8344720 [details]
14507.html

thanks German!
Attachment #8344720 - Flags: review?(jmcf) → review+
Merged in master: https://github.com/mozilla-b2g/gaia/commit/1b5c645dfa86f02a08315b12d8d3cd7d530b30a5
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
traige: 1.3+ for regression
blocking-b2g: 1.3? → 1.3+
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
Whiteboard: [xfail] → [xfail] burirun1.3-1
Should we un-xfail on master?
Flags: needinfo?(zcampbell)
we have un-xfailed test_add_photo_to_contact.py by Bug 949364
Flags: needinfo?(zcampbell)
Hey John,

do we need anything else to uplift this?
Flags: needinfo?(jhford)
[v1.3 0565faa] Merge pull request #14507 from gtorodelvalle/contacts-bug-942010-self-duplicate
Flags: needinfo?(jhford)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: