Closed Bug 1189884 Opened 5 years ago Closed 5 years ago

[Contacts] Sometimes Contacts cannot be imported from SIM card

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(blocking-b2g:2.5+, firefox42 fixed, b2g-master verified)

VERIFIED FIXED
FxOS-S4 (07Aug)
blocking-b2g 2.5+
Tracking Status
firefox42 --- fixed
b2g-master --- verified

People

(Reporter: Marty, Assigned: bevis)

References

Details

(Keywords: regression, Whiteboard: [2.5-Daily-Testing][Spark])

Attachments

(3 files)

Attached file Contacts.vcf
Description:
Recently, the contacts app has been unable to import contacts from specific SIM cards that were importable on previous builds. The device will merely show the importing animation screen indefinitely, until the action is cancelled by the user. This occurs with SIM cards that seem to have specific contacts that cause this problem, as after removing a few contacts that seemed to have irregular data fields, importing from the SIM began working again.

Using an affected SIM card, I imported the contacts on an earlier, working build and saved the contacts to a VCF file attached here, in the hopes that the problematic contacts (Specifically the Roaming Sim, T_Mobile, and WAP_Push contacts) 

Prerequisites: There is a SIM card with contacts inserted into the device

Repro Steps:
1) Update a Aries to 20150730145424
2) Launch the Contacts app and navigate to Settings
3) Select Import Contacts > SIM card

Actual:
App will import contacts indefinitely

Expected:
Contacts can be imported successfully

Environmental Variables:
Device: Aries 2.5
Build ID: 20150730145424
Gaia: 1d3595836bd55b70478923d771051268a5dabf91
Gecko: 305ba37a62f8
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 42.0a1 (2.5)
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0

Repro frequency: 10/10 on affected SIMs
See attached: logcat, vcf
Attached file logcat-sim-import.txt
This issue DOES occur on current Flame 2.5 builds.
App will import contacts indefinitely

Environmental Variables:
Device: Flame 2.5
Build ID: 20150730030209
Gaia: bf8565e0c3ad216ccb3f109c17f8a2eb2c42f6b8
Gecko: 62469b20ec84
Gonk: 41d3e221039d1c4486fc13ff26793a7a39226423
Version: 42.0a1 (2.5)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0

------------------------------------------------

This issue does NOT occur on previous Aries and Flame builds in the 2.5 branch
Contacts can be imported successfully

Environmental Variables:
Device: Aries 2.5
Build ID: 20150727151800
Gaia: 4e3e21a4ba3f188b45623ee2297f21d0791f8667
Gecko: 21ca97268bae
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 42.0a1 (2.5)
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(pbylenga)
[Blocking Requested - why for this release]:
Functional regression blocking import from SIM

Asking for a window to help identify what's going on.  Will need an affected SIM, reporter has one handy.
blocking-b2g: --- → 2.5?
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(pbylenga)
B2G Inbound Regression Window

Last Working
Device: Flame 2.5
BuildID: 20150727091845
Gaia: 302a448729ff2b336581cf94b66327ea836294c7
Gecko: 0c4e711effd2
Version: 42.0a1 (2.5) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0

First Broken 
Device: Flame 2.5
BuildID: 20150727095945
Gaia: 302a448729ff2b336581cf94b66327ea836294c7
Gecko: 8bb069f2ec5f
Version: 42.0a1 (2.5) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0

Last Working Gaia and First Broken Gecko
Issue DOES occur here
Gaia: 302a448729ff2b336581cf94b66327ea836294c7
Gecko: 8bb069f2ec5f

Last Working Gaia and First Broken Gecko
Issue DOES NOT occur here
Gaia: 302a448729ff2b336581cf94b66327ea836294c7
Gecko: 0c4e711effd2

B2G Inbound pushlog (Gecko): 
hg.mozilla.org/integration/b2g-inbound/pushloghtml?fromchange=0c4e711effd2&tochange=8bb069f2ec5f

Possible Cause: 

Bug 1114937 - [B2G][ICC] Refactor Icc Contacts in MozIcc.webidl with IPDL.
Blocks: 1114937
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
QA Contact: ddixon
Bevis, can you take a look at this please? This might have been caused by the landing for bug 1114937.
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Comms triage: Functional regression.
blocking-b2g: 2.5? → 2.5+
Flags: needinfo?(btseng)
Thanks for reporting this issue.

Sorry to have this regression. I'll take this to follow up.

Meanwhile, is it possible to capture the logcat with RIL debug flag enabled for further analysis?
This can be enabled by checking the "RIL Output in ADB" in the developer menu of Settings.

Thanks!
Assignee: nobody → btseng
Component: Gaia::Contacts → RIL
Flags: needinfo?(mshuman)
(In reply to Bevis Tseng[:bevistseng][:btseng] from comment #7)
> Thanks for reporting this issue.
> 
> Sorry to have this regression. I'll take this to follow up.
> 
> Meanwhile, is it possible to capture the logcat with RIL debug flag enabled
> for further analysis?
> This can be enabled by checking the "RIL Output in ADB" in the developer
> menu of Settings.
> Thanks!

Sorry, the RIL related logs were enabled already in the attached log.
Flags: needinfo?(mshuman)
Flags: needinfo?(btseng)
Root cause is found.
We didn't handle the ANR field from SIMContacts properly:
[JavaScript Error: "ReferenceError: anr is not defined" {file: "jar:file:///system/b2g/omni.ja!/components/IccService.js" line: 99}]

https://hg.mozilla.org/mozilla-central/file/32712cd01159/dom/icc/gonk/IccService.js#l99
It shall be:
> let anrLen = aContact.anr ? aContact.anr.length : 0;
> for (let i = 0; i < anrLen; i++) {
>   this._numbers.push(aContact.anr[i]);
>}


We should have ANR in our test coverage as well.
It takes time to enable test cases for USIM contacts from emulator. See bug 824904.

I'll provide a quick fix for this first to prevent blocking foxfooding.
Depends on: 824904
Hi Edgar,

May I have your review for this quick fix?

Thanks!
Attachment #8642387 - Flags: review?(echen)
Comment on attachment 8642387 [details] [diff] [review]
Patch: Read/Update ANR of SIM Contact Properly.

Review of attachment 8642387 [details] [diff] [review]:
-----------------------------------------------------------------

Thank you.
Attachment #8642387 - Flags: review?(echen) → review+
https://hg.mozilla.org/mozilla-central/rev/7194e763b398
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S4 (07Aug)
Tested in Flame with latest master build and with a SIM that these last days was suffering the bug  with a 100% repro frecuency and now it works as expected. Thanks! 

Environmental Variables:
flame master (2.5 version)
Build ID: 20150805111547
Gecko: c282e7e
Gaia: b795c40
Platform version: 42.0a1
This issue is verified fixed on the latest Flame Master build.
The Contacts app is able to successfully import from a previously affected SIM card.

Environmental Variables:
Device: Flame 2.5
Build ID: 20150805030212
Gaia: c5425d9f1f5184731a59ed4bc99295acbde30390
Gecko: f3b757156f69
Gonk: 41d3e221039d1c4486fc13ff26793a7a39226423
Version: 42.0a1 (2.5)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0
Status: RESOLVED → VERIFIED
Flags: needinfo?(ktucker)
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
You need to log in before you can comment on or make changes to this bug.