Closed Bug 938219 Opened 11 years ago Closed 11 years ago

[Contacts] Unable to select a contact via the contact "update" activity

Categories

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

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

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

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

People

(Reporter: gtorodelvalle, Assigned: gtorodelvalle)

References

Details

(Keywords: regression)

Attachments

(1 file)

TO REPRODUCE:
1. Create at least one contact in case there is no contacts created.
2. Go to any application which may launch the Contacts app "pick" activity such as the Dialer app (via the "add contact" button on the lower left area), the Email app (via clicking on any email address) or SMS app (clicking on the header of a SMS thread). Launch the contact pick activity.
  2.1. In case of the Dialer app:
    2.1.1. Type a phone number.
    2.1.2. Click on the "add contact" button.
    2.1.3. Select the "Add to existing contact" option.
  2.2. In case of the Email app:
    2.2.1. Open any email.
    2.2.2. Click on the email address of the sender or any of the addressees.
    2.2.3. Select the "Add to existing contact" option.
  2.3. In case of the SMS app:
    2.2.1. Open any SMS thread.
    2.2.2. Click on the header of the SMS thread.
    2.2.3. Select the "Add to existing contact" option.
3. The contact list is shown letting the user to select any contact.
4. Click on any contact from the list.

EXPECTED RESULT:
5. The details of the selected contact are shown in edit mode.

ACTUAL RESULT:
5. Nothing happens.
blocking-b2g: --- → koi?
QA Contact: rafael.marquez
Assignee: nobody → gtorodelvalle
Whiteboard: regression
Whiteboard: regression
Depends on: 938261
For some strange reason, when accessing the 'tel' property of a contact (no matter if using dot notation or Array notation) from the Contacts app when handling the pick activity throws the following error: [JavaScript Error: "Argument 1 of ContactTelField.initialize can't be converted to a sequence." {file: "jar:file:///system/b2g/omni.ja!/components/ContactManager.js" line: 245}]

I just created bug 938261 for DOM:Contacts.
Is contact manager failing? What device is in question when tested?
Flags: needinfo?(gtorodelvalle)
are we sure this reproduces on v1.2? it seems a WebIDL regression and that code has not landed on v1.2
Flags: needinfo?(jsmith)
+1 to Jose comment, the error looks like it's related to webidl changes.
Yeah guys, you are right ;-) Rafa from QA just confirmed that, obviously, it does not reproduce in 1.2 since it is related to the latest WebIDL changes ;-) Thanks for pointing that out ;)
blocking-b2g: koi? → 1.3?
Flags: needinfo?(gtorodelvalle)
Blocks: 850430
Flags: needinfo?(jsmith)
traige: regression 1.3+
blocking-b2g: 1.3? → 1.3+
Correction for comment 1: it doesn't fail for "pick", nor for "open", nor for "new". It fails only for the "update" activity.

It also doesn't fail when showing a contact from the contacts app outside of an activity.

German, I'm trying to debug bug 938261. Can you please show me the place where the "update" activity fails in the contacts code?
Flags: needinfo?(gtorodelvalle)
Summary: [Contacts] Unable to select a contact via the contact pick activity → [Contacts] Unable to select a contact via the contact "update" activity
Hi Julien! For example, when trying the Dialer case (2.1.1 to 2.1.3), I get:

E/GeckoConsole(  713): [JavaScript Error: "Argument 1 of ContactTelField.initialize can't be converted to a sequence." {file: "jar:file:///system/b2g/omni.ja!/components/ContactManager.js" line: 245}]
E/GeckoConsole(  713): [JavaScript Error: "NS_ERROR_UNEXPECTED: " {file: "app://communications.gaiamobile.org/contacts/js/views/form.js" line: 256}]

So, regarding the Contacts app, the line is https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/js/views/form.js#L256 which is the place where the 'tel' property is being accessed. Anyhow, as you see in the logs, there is a problem with ContactManager.js in line 245 :-(

Hope that helps ;-)
Flags: needinfo?(gtorodelvalle)
Yep, I've found the issue in the contacts API, but I try to understand the whole picture to see where something should be fixed.

Thanks, I should have found this line myself! :)
No no, no problem ;-)
So, the problem initially comes from [1]: the type is not an array here. Then the 'extras' parameter is eventually added to the contact in [2].

I suspect the same issue will happen for email just below [1] too.

So the fix in the Contacts app is easy, but I'll see in bug 938261 if we can get an early error instead of finding the error later in the code.

German, can I let you fix the contacts code?

[1] https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/js/contacts.js#L284-L300
[2] https://github.com/mozilla-b2g/gaia/blob/master/apps/communications/contacts/js/contacts.js#L83
Flags: needinfo?(gtorodelvalle)
Blocks: 948472
Filed bug 948473 and bug 948472 to add integration tests around these activities.
German, by the way, for next time, it's way easier to have a reduced testcase (that is: a very simple page and code that demonstrates the problem and the problem only) to fix issues. In case of a Gecko issue, it saves time for the Gecko developer, and in this case, the coding issue would have been made obvious. So it's a Win in all situations! :-)
Hi Julien, thanks for the hint :-)

Regarding the provided test case, just wanted to provide as many information as possible at the time of the finding of the issue. But totally agree with you when possible ;-)
Flags: needinfo?(gtorodelvalle)
Attached file 14581.html
Attachment #8345963 - Flags: review?(jmcf)
Comment on attachment 8345963 [details]
14581.html

looks good German

thanks!
Attachment #8345963 - Flags: review?(jmcf) → review+
QA Contact: rafael.marquez → isabelrios
Merged in master: https://github.com/mozilla-b2g/gaia/commit/390b313a254a947d12e3cdbcde19d7d1619ff63c
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
Uplifted 390b313a254a947d12e3cdbcde19d7d1619ff63c to:
v1.3: 202c1506782525ace1cc006feddf428e2ba8512f
Verified on latest buri 1.3 build (01/08):

Gecko-e499b1f
Gaia-d578331
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: