Closed Bug 1138259 Opened 9 years ago Closed 9 years ago

[Monitor][Contacts]Some contact doesn't deleted when from dialer to contacts.

Categories

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

defect

Tracking

(blocking-b2g:2.5+, b2g-v2.0 affected, b2g-v2.0M unaffected, b2g-v2.1 affected, b2g-v2.1S affected, b2g-v2.2 affected, b2g-master affected)

RESOLVED WORKSFORME
blocking-b2g 2.5+
Tracking Status
b2g-v2.0 --- affected
b2g-v2.0M --- unaffected
b2g-v2.1 --- affected
b2g-v2.1S --- affected
b2g-v2.2 --- affected
b2g-master --- affected

People

(Reporter: sync-1, Unassigned)

References

Details

Attachments

(6 files, 1 obsolete file)

contact is not completely removed!
 
 DEFECT DESCRIPTION:
 Some contact doesn't deleted when from dialer to enter contacts,but the contact display empty from Contacts.
 
  REPRODUCING PROCEDURES:
 1.Enter Contacts->Settings->Import Contacts->SD card,
 2.Import contact about 400
 3.Delete Contacts->Select all->Delete
 4.Enter Contact from Dialer during Deleting,slide the screen then wait a few minutes
 
  EXPECTED BEHAVIOUR:
 The contact should be accord with Contacts.
 
 >0752-2639336/61336
 
  ASSOCIATE SPECIFICATION:
 
  TEST PLAN REFERENCE:
 
  TOOLS AND PLATFORMS USED:
 
  USER IMPACT:
 
  REPRODUCING RATE:
 
  For FT PR, Please list reference mobile's behavior:
Hi Norry,
qawanted for Woodduck 2.0M and Flame 2.0/2.1/2.2. Thanks!
Blocks: Woodduck
Flags: needinfo?(fan.luo)
Keywords: qawanted
QA Contact: bzumwalt
Issue DOES occur on Flame 2.0, 2.1, 2.2, and 3.0

After importing 500 contacts from SD card, navigating to contacts tab in Dialer while deleting these contacts as a group in the Contacts app has 11+ contacts remaining visible (though not clickable) in the dialer after the deletion process finishes. These remaining contacts are usually the first contacts in the list. These contacts remain visible until Dialer is closed and re-opened.

Leaving qawanted tag for Woodduck check as I do not have access to that device.

Device: Flame 2.0
Build ID: 20150303000222
Gaia: 366aaa19ac474dc58b79d62a91cff41756ae9dfe
Gecko: 442332896430
Version: 32.0 (2.0)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0

Device: Flame 2.1
Build ID: 20150303001808
Gaia: 5d3479fdd438412adee4452720856b6b771fe5cd
Gecko: 0a534b3a14b9
Gonk: Could not pull gonk.  Did you shallow Flash?
Version: 34.0 (2.1)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0

Device: Flame 2.2
Build ID: 20150303002527
Gaia: 3d188c414e30acc392253d5389a42352fcfbc183
Gecko: c89aad487aa5
Version: 37.0 (2.2)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0

Device: Flame 3.0
Build ID: 20150303010233
Gaia: c8ed1085a67490a1ecd7f275e5de9487e1b93b1d
Gecko: 0b3c520002ad
Version: 39.0a1 (3.0)
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:39.0) Gecko/39.0 Firefox/39.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Attached video video
This problem cannot be repro on latest build of Woodduck 2.0, but it can be repro on 2.1S (512mb).
See attachment: logcat_2.1S_2143.txt & 2.1S_Video.MP4
Occurrence time: 21:43
Fail rate: 3/6

Woodduck 2.0 build:
Build ID               20150304050313
Gaia Revision          a1b5959728c8bc2a82354e197bb161922d419866
Gaia Date              2015-02-13 09:00:02
Gecko Revision         d9b299dc1087f23c83321b4dccc92e0f52309e8e
Gecko Version          32.0
Device Name            jrdhz72_w_ff
Firmware(Release)      4.4.2
Firmware(Incremental)  1425416986
Firmware Date          Wed Mar  4 05:10:20 CST 2015

2.1S_512m build:
Build ID               20150303001230
Gaia Revision          a43d64ae01ef108aa4dcc971c770fecd8416a764
Gaia Date              2015-02-26 09:24:39
Gecko Revision         https://hg.mozilla.org/releases/mozilla-b2g34_v2_1s/rev/0afb09986331
Gecko Version          34.0
Device Name            scx15_sp7715ea
Firmware(Release)      4.4.2
Firmware(Incremental)  122
Firmware Date          Thu Feb  5 12:42:58 CST 2015
Flags: needinfo?(fan.luo)
Attached file logcat
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage+][MGSEI-Triage+]
Keywords: qawanted
Hi Gary,
Could you please help to check the problem? Thanks!
Flags: needinfo?(gchen)
Blocks: Woodduck_P2
Assignee: nobody → gchen
Flags: needinfo?(gchen)
Component: Gaia → Gaia::Contacts
Comment on attachment 8573733 [details] [review]
[gaia] mpizza:Bug_1138259_master > mozilla-b2g:master

Hi francisco,
   According to STR, it will case two instances (dialer and contacts APP) have difference contactList count, so I added some operator in visibilitychange handler for fixing this issue.
   
   Could you help to review this patch and give me some feedback?
   Thanks.
Attachment #8573733 - Flags: review?(francisco)
Hi Gary,

did you check if the 'oncontactchange' event is being fired in all the windows?
Flags: needinfo?(gchen)
Hi Franciso,
   Actually I've checked it, but I can't distinguish which event was received by dialer or contacts.
   So I suspect dialer missed some 'oncontactchange' events when it was set to background.
Flags: needinfo?(gchen)
Status: NEW → ASSIGNED
Hi Zhang-Lei.
PLease try patch of https://bugzilla.mozilla.org/attachment.cgi?id=8573733.
Thanks
Flags: needinfo?(zhang-lei)
(In reply to comment #13)
 > Comment from Mozilla:Hi Zhang-Lei.
 > PLease try patch of https://bugzilla.mozilla.org/attachment.cgi?id=8573733.
 > Thanks
 > 
 
 ok,I will try later,Our company network can't work now!!
(In reply to GaryChen [:GaryChen][:PYChen][:陳柏宇] from comment #9)
> Hi Franciso,
>    Actually I've checked it, but I can't distinguish which event was
> received by dialer or contacts.
>    So I suspect dialer missed some 'oncontactchange' events when it was set
> to background.

If that's happening then it's a gecko error, since the event oncontactchange should be triggered even if we are in the background. Actually was created for this case where we had a background page.

I will prefer if we ask the gecko engineers to restore the oncontactchange problem (if finally that's the case). Cause that's been working since version 1.0.1 and this bug was the reason to creating and adding that code originally.
Hi Shawn,
Could you please help to check the problem? Thanks!
Flags: needinfo?(sku)
Dear Jacob,
Could you please help to find someone from productivity gecko side to check this issue as well?
Thank you very much!
Flags: needinfo?(jshen)
Perhaps Reuben can tell us more about the 'oncontactchange' not being fired when we are in the background too?

Reuben, this should work isnt?
Flags: needinfo?(reuben.bmo)
I pathed and tested the code from https://bugzilla.mozilla.org/attachment.cgi?id=8573733.
 It has not been fixed completely: when trigger "visibilitychange", it is ok, but if stay on current page, the issue is still exist.
Yes, this should work for any window that has the contacts-listen permission granted, and that has a listener or handler on the event. The code that handles this hasn't been changed for a very long time.
Flags: needinfo?(reuben.bmo)
Hi Reuben,
   Thanks for your replying, in this scenario it would cause 'contacts.List.total' difference with real count which retrieve from API |window.navigator.mozContacts.getCount()|.
   So that's why I suspect dialer missed some 'oncontactchange' events, is it possible we missed some corner case like this issue?
Flags: needinfo?(reuben.bmo)
Hi francisco,
   I found a easy STR to reproduce this issue.
   In my inspect dialer can't get |contacts.list| current when it received 'oncontactchange'.
   Could you give me some clues?

step 1, import 500 contacts into your phone.
step 2, launch contacts app wait for loading all contacts.
step 3, delete all contacts and wait a while (at least 100 contacts was deleted) then press home key.
step 4, launch dialer app and switch to contacts panel, then you will see the contacts doesn't work fine.

-----
Gaia-Rev        04e9347bbe56d0e9959983d5cd6f188a9ac646b5
Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/c33922ee3ac3
Build-ID        20150311170314
Version         39.0a1
Device-Name     flame
FW-Release      4.4.2
FW-Incremental  65
FW-Date         Mon Dec 15 18:51:29 CST 2014
Bootloader      L1TC000118D0
Flags: needinfo?(zhang-lei) → needinfo?(francisco)
Attached image IMG_8423.JPG
Attachment #8573733 - Attachment is obsolete: true
Attachment #8573733 - Flags: review?(francisco)
Flags: needinfo?(sku)
Flags: needinfo?(jshen)
(In reply to GaryChen [:GaryChen][:PYChen][:陳柏宇] from comment #19)
> Hi francisco,
>    I found a easy STR to reproduce this issue.
>    In my inspect dialer can't get |contacts.list| current when it received
> 'oncontactchange'.
typo: current -> correct
>    Could you give me some clues?
> 
> step 1, import 500 contacts into your phone.
> step 2, launch contacts app wait for loading all contacts.
> step 3, delete all contacts and wait a while (at least 100 contacts was
> deleted) then press home key.
> step 4, launch dialer app and switch to contacts panel, then you will see
> the contacts doesn't work fine.
> 
> -----
> Gaia-Rev        04e9347bbe56d0e9959983d5cd6f188a9ac646b5
> Gecko-Rev       https://hg.mozilla.org/mozilla-central/rev/c33922ee3ac3
> Build-ID        20150311170314
> Version         39.0a1
> Device-Name     flame
> FW-Release      4.4.2
> FW-Incremental  65
> FW-Date         Mon Dec 15 18:51:29 CST 2014
> Bootloader      L1TC000118D0
Hey Gary, could it be possible that one of the apps got kill?
Flags: needinfo?(francisco)
Hi Francisco,
   Maybe I didn't describe clearly, per comment #19, dialer app launches as new app during contacts app is deleting data, it might case this issue.  It mean's dialer can't receive 'oncontactschaned' event until it is launches and in my inspect if another app is deleting data via mozContacts API, it may let the other one can't get correct information from mozContacts API, just like this situation.
   I don't have any idea for resolving it, although it looks like a corner case but we never consider it before. I think if we can split dialer and contacts as two APPS, this issue should not be exist, unfortunately it can't be happened easily. 
   Maybe I am on the wrong way, could you give any suggestion? 
   I'd love to help on this issue.
   Thanks.
Hi Gary,

we are suppose to split them at some point :)

It definitely looks like an extreme corner case. The corner case that I see is requesting the getAll while we are erasing and the cursor giving us incorrect information?

In that case I'll wait for Reuben feedback to know if the cursor maybe affected.

IMO, we should wait till dialer and contacts are separated, that probably will happen in v3.
Flags: needinfo?(gchen)
[Blocking Requested - why for this release]:
PLease check comment 24 for separating dialer and contacts.
No longer blocks: Woodduck_P2
blocking-b2g: --- → 3.0?
not focus on this issue, un assign first.
Assignee: gchen → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(gchen)
Comms triage: Synchronization issue which can lead to data loss.
blocking-b2g: 3.0? → 3.0+
Component: Gaia::Contacts → DOM: Contacts
Product: Firefox OS → Core
Francisco, Is this bug still a 2.5+ bug?
Flags: needinfo?(francisco)
Yes, this is still a blocker since we can lose data cause of this bug.
Flags: needinfo?(francisco)
Can someone who can reproduce this bug try this patch and see if it makes any difference? I don't have a build I can easily test with right now.
Flags: needinfo?(reuben.bmo)
Hi Norry,
Can you help to find someone who can help apply the patch per comment 30 on master?
Flags: needinfo?(fan.luo)
Hi Josh,

    This bug still can be repro on Flame master after building the patch ('Clear getAll cache on clear') of comment 30 by the STR in comment 19.

Actual results: Sometimes some contacts are not deleted and still display in contact tab, and sometimes it shows blank screen in contact tab where it has search bar and alphabets. If you tap "+" icon and then tap "X" to back to contact tab in Dialer app, it will show normally with no deleted contact displaying.

See attachments: patch_Flame_v2.5.3gp and logcat.txt
Reproduce rate: 10/10


Device: Flame KK 2.5 (affected, 319MB)
Build ID               20150812125204
Gaia Revision          d0b431ee99feb8d312f7388c0c62294b3abfd12b
Gaia Date              2015-08-11 23:25:05
Gecko Revision         n/a
Gecko Version          43.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.rose.20150811.161627
Firmware Date          2015-08-11 Tuesday 16:16:49 CST
Bootloader             L1TC000118D0
Flags: needinfo?(fan.luo) → needinfo?(jocheng)
Keywords: regression
Hi Reuben,
It seems the issue still exist. Can you check comment 32 from Shally? Thanks!
Flags: needinfo?(jocheng) → needinfo?(reuben.bmo)
Reuben/Gregor, Can you please take a look at this once? Its untouched for past 4 weeks. 

Thanks
Flags: needinfo?(anygregor)
Looking.
Assignee: nobody → reuben.bmo
Flags: needinfo?(reuben.bmo)
Flags: needinfo?(anygregor)
Status: NEW → ASSIGNED
Sorry, I got sidetracked by bug 1202788. I can't reproduce with the STR from comment 19 in a debug build - I get an empty contacts list in the dialer. I'll try with an optimized build.
This looks like a Gaia bug. We're definitely sending the contactchange events on the API side. No API calls are made when I open the dialer and switch to the contacts view, leading me to believe there's some sort of caching happening. The data shown in the dialer UI is not being sent by the Contacts API.
Assignee: reuben.bmo → nobody
Status: ASSIGNED → NEW
Component: DOM: Contacts → Gaia::Contacts
Product: Core → Firefox OS
If I understnad properly, the issue here is when we display the contacts in Dialer _while_ some contacts are being deleted in the Contacts app.

Does it work properly if we wait until the deleting operation is finished before opening the contacts in Dialer ?
Keywords: qawanted
(In reply to Julien Wajsberg [:julienw] from comment #40)
> Does it work properly if we wait until the deleting operation is finished
> before opening the contacts in Dialer ?

Yes it does work properly if we wait until deleting is finished; launching Phone > tap on Contacts tab displays empty contacts, matching with actual Contacts app.

Device: Flame 2.5
BuildID: 20150914030233
Gaia: 4d9b996be4b1935651057d0651461c1a36d98a18
Gecko: 9ed17db42e3e46f1c712e4dffd62d54e915e0fac
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 43.0a1 (2.5) 
Firmware Version: v18Dv4
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Device: Aries 2.5
BuildID: 20150914130903
Gaia: f37e8f732e0af961b43e912629c84c9e2ceda55d
Gecko: fba4b0cd3823975949765acc0b16b964d1712b75
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 43.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

I'm removing regression keyword because this is not a regression. The bug reproduces on all branches of Flame.
QA Whiteboard: [QAnalyst-Triage+][MGSEI-Triage+] → [QAnalyst-Triage?][MGSEI-Triage+]
Flags: needinfo?(jmercado)
Keywords: qawanted
QA Whiteboard: [QAnalyst-Triage?][MGSEI-Triage+] → [QAnalyst-Triage+][MGSEI-Triage+]
Flags: needinfo?(jmercado)
Thanks, this is a lot clearer for me now.

Ferjm, maybe you have an idea on how to fix this?

My own idea is: WONTFIX :p
Flags: needinfo?(ferjmoreno)
After checking comments for Reuben saying that the oncontactchange is emitted, doesn't make much sense to me.

In contacts we listed to that event and if it's a delete operation we remove from the list. Also we batch the requests. Cause we could get several of those events we save them in a buffer for being sure that we execute the delete operation for all ids that we get.

The result you can see in the following video:
https://youtu.be/li8rsqdk_FA

So when we delete all the contacts from the contacts app, and we go to the dialer, as the result of performing batches operations the user can see how the contacts list is getting modified until it's empty. IMO, that should be the correct behavior.

I'm closing this bug as worksforme, if anyone see a different problem please reopen.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(ferjmoreno)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: