Closed Bug 1217075 Opened 4 years ago Closed 4 years ago

[Messages] Both message and draft are preserved in the main app instance in case message is sent from another activity instance (until app is restarted)

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(blocking-b2g:2.5+, b2g-v2.2 unaffected, b2g-master verified)

VERIFIED FIXED
blocking-b2g 2.5+
Tracking Status
b2g-v2.2 --- unaffected
b2g-master --- verified

People

(Reporter: vbelonenko, Assigned: steveck)

References

()

Details

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

Attachments

(3 files)

Description:
Sending a message from contacts, it creates two messages one with text and another empty without text.

Repro Steps:
1) Update a Aries to 20151021111747
2) Select Contacts and Create a contact
3) From Contact write a message
4) Open message app
5) Observe that message app created two messages.

Actual:
Sending a message from contact, it creates two messages one with text and another empty without text.

Expected:
After sending a message there should be one message on the screen.

Environmental Variables:
Device: Aries Master 2.5 kk full flash
Build ID: 20151021111747
Gaia: 32d827a70af90a05918f234e5b16b35d5d2a07e8
Gecko: d43374e6970311c0a14f25f3ec09d2a30448a2b2
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 44.0a1 (Master)
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

Repro frequency: 3/3
See attached: video clip and logcat
Component: Gaia::System::Window Mgmt → Gaia::Contacts
[Blocking Requested - why for this release]:
blocking-b2g: --- → 2.5?
This issue does not occurs on 2.5 flame and 2.2 flame

Environmental Variables:
Device: Flame Master 2.5 flame kk full flash 
Build ID: 20151021065025
Gaia: 32d827a70af90a05918f234e5b16b35d5d2a07e8
Gecko: 473aefe5bd85842eeb142e0cde8e2cd21edbf40b
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 44.0a1 (Master)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

Device: Flame 2.2 kk full flash 
Build ID: 20151021032506
Gaia: 885647d92208fb67574ced44004ab2f29d23cb45
Gecko: d546c2eb1c0c
Gonk: bd9cb3af2a0354577a6903917bc826489050b40d
Version: 37.0 (2.2)
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
QA Whiteboard: [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Summary: After sending a message from contacts , it creates two messages. → [Aries] After sending a message from contacts , it creates two messages.
Julien is this familiar for you? Rings any belll?
Flags: needinfo?(felash)
Comms triage: Broken functionality. The fact that it happens only on Aries might show a regression that happened between 20151021032506 and 20151021111747. It might also be a carries specific issue. Isabel, could you check if the same Aries build shows the bug on your side?
blocking-b2g: 2.5? → 2.5+
Flags: needinfo?(isabelrios)
Not at all, and this is especially weird that it does not happen on Flame.

I suspect a race, and could come from bug 1176976 (as I see a draft is created).

We should block IMO.
blocking-b2g: 2.5+ → 2.5?
Flags: needinfo?(felash)
Ooops sorry for the renomination.
(In reply to Johan Lorenzo [:jlorenzo] (QA) from comment #4)
> Comms triage: Broken functionality. The fact that it happens only on Aries
> might show a regression that happened between 20151021032506 and
> 20151021111747.

Well, they both use the same Gaia commit hash :)
(but not the same Gecko !)
:)
blocking-b2g: 2.5? → 2.5+
Component: Gaia::Contacts → Gaia::SMS
Flags: needinfo?(isabelrios) → needinfo?(irios.mozilla)
I could have the 2.5 Aries build with same Gecko and Gaia, although the Buildid is different: 20151021104148 and the bug is reproducible.

So, it does not seem like a carrier related issue.

With Flame 2.5 same Gecko and Gaia than reported in the bug and BuildId: 201510211004102 it is not reproducible. 
With latests 2.5 Flame and Aries builds, I cannot reproduce it either.

Aries:
BuildId: 20151022002834
Gaia:1b902ff2
Gecko: daa7d98

Flame:
BuildId:20151021193201
Gaia:1b902ff2
Gecko: daa7d98
Flags: needinfo?(irios.mozilla)
It looks like we didn't store the draft actually. If you restart the app the draft will disappear. I think we do trigger the draft change at certain timing, but we should update the UI correctly after message sent.
Assignee: nobody → schung
There is an extra step before this issue occurs, you need to have the messages app open before performing the repro steps in the Description.

I was able to reproduce this issue in flame 2.5 with this additional step. I was still unable to reproduce in Flame 2.2 with this additional step though.

Environmental Variables:
Device: Flame 2.5 [Full Flash]
BuildID: 20151021064220
Gaia: 32d827a70af90a05918f234e5b16b35d5d2a07e8
Gecko: 473aefe5bd85842eeb142e0cde8e2cd21edbf40b
Gonk: 040bb1e9ac8a5b6dd756fdd696aa37a8868b5c67
Version: 44.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0
Summary: [Aries] After sending a message from contacts , it creates two messages. → After sending a message from contacts , it creates two messages.
QA Whiteboard: [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
QA Contact: jmercado
The changes for bug Bug 1176976 seem to have caused this issue.

B2g-inbound Regression Window

Last Working 
Environmental Variables:
Device: Flame 2.5
BuildID: 20150929065524
Gaia: 998be1d6137b5b4fa2ed42d6f4d847288839b7e5
Gecko: eb96b66e39e187fd8bc16e3514dc6c1b49d8c40e
Version: 44.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

First Broken 
Environmental Variables:
Device: Flame 2.5
BuildID: 20150929073456
Gaia: c7dbd85db1b9d143d3fbbeaaf0c7b7062c6c1fa4
Gecko: 1debc6216dbb5711751951bc52dcaa0659535bb5
Version: 44.0a1 (2.5) 
Firmware Version: v18D
User Agent: Mozilla/5.0 (Mobile; rv:44.0) Gecko/44.0 Firefox/44.0

Last Working gaia / First Broken gecko - Issue does NOT occur
Gaia: 998be1d6137b5b4fa2ed42d6f4d847288839b7e5
Gecko: 1debc6216dbb5711751951bc52dcaa0659535bb5

First Broken gaia / Last Working gecko - Issue DOES occur
Gaia: c7dbd85db1b9d143d3fbbeaaf0c7b7062c6c1fa4
Gecko: eb96b66e39e187fd8bc16e3514dc6c1b49d8c40e

Gaia Pushlog: https://github.com/mozilla-b2g/gaia/compare/998be1d6137b5b4fa2ed42d6f4d847288839b7e5...c7dbd85db1b9d143d3fbbeaaf0c7b7062c6c1fa4
Blocks: 1176976
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Oleg this issue seems to have been caused by the changes for bug 1176976.  Can you please take a look?
Flags: needinfo?(azasypkin)
It's OK, Steve is looking into it :) Thanks for the regression window !
Flags: needinfo?(azasypkin)
I haven't looked closer yet, but it sounds exactly like what we want to fix in bug 1080504 for a long time already. Patches from bug 1144132, bug 1162030 and bug 1176976 increased number of cases when we create drafts and hence share them with the second app instance, but we never actually updated/discarded them - looks like a good time to fix it, e.g. using bug 1080504 comment 3.
And we can dupe this one (as many other old and new cases that are not uncovered yet) to bug 1080504
Summary: After sending a message from contacts , it creates two messages. → [Messages] Both message and draft are preserved in the main app instance in case message is sent from another activity instance (until app is restarted)
Comment on attachment 8678057 [details] [review]
[gaia] steveck-chung:bug-1217075-dup-draft > mozilla-b2g:master

Hi Oleg, in the patch I simply sync the draft save/delete event and emit to another instance. I think you must be very familiar with this part and please let me know if you have another thoughts, thanks!
Attachment #8678057 - Flags: feedback?(azasypkin)
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Comment on attachment 8678057 [details] [review]
[gaia] steveck-chung:bug-1217075-dup-draft > mozilla-b2g:master

I haven't tried on device, but the idea looks good to me! I've left one proposition and once potential, but very edgy concern about batch deletion.

And maybe let's move patch to bug 1080504 and dupe this one to it?

Thanks!
Attachment #8678057 - Flags: feedback?(azasypkin) → feedback+
Status: NEW → ASSIGNED
Users will be confused.
Priority: -- → P1
Comment on attachment 8678057 [details] [review]
[gaia] steveck-chung:bug-1217075-dup-draft > mozilla-b2g:master

Hi Oleg,
The suggestion is great and I didn't find any significant memory issue while performing any batch drafts access. The patch is updated with tests, thanks!
Attachment #8678057 - Flags: review?(azasypkin)
Patch updated and rebased, thanks for the advice!
Comment on attachment 8678057 [details] [review]
[gaia] steveck-chung:bug-1217075-dup-draft > mozilla-b2g:master

Looks great, thanks for the quick fix! I've left just two minor nits, but overall it looks like what we wanted for a long time already :)
Attachment #8678057 - Flags: review?(azasypkin) → review+
In master: https://github.com/mozilla-b2g/gaia/commit/68febcc83f4efc2122c784aa01fbfdbc4b3f8151

Thanks for the review!
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Vlad, can you verify that this is fixed?
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage-]
Flags: needinfo?(vbelonenko)
Keywords: verifyme
This issue is verified fixed in the latest Aries Master 2.5
After sending a message from contacts one message appears inside the messages app.

Environmental Variables:
Device: Aries Master 2.5
Build ID: 20151029124810
Gaia: 91cac94948094cfdcd00cba5c6483e27e80cb3b0
Gecko: acb3f4ac5424181d3d4d73283668162137918cf1
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 45.0a1 (Master)
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:45.0) Gecko/45.0 Firefox/45.0
Flags: needinfo?(vbelonenko)
This bug is also verified fixed in the latest FlameKK Master 2.5. So clear 'verifyme' keywords.

Actual results: After sending a message from contacts one message appears inside the messages app.
See attachment: verified_Flame_v2.5.3gp
Reproduce rate: 0/10


Device: Flame KK 2.5 (Pass)
Build ID               20151029150245
Gaia Revision          91cac94948094cfdcd00cba5c6483e27e80cb3b0
Gaia Date              2015-10-28 20:32:15
Gecko Revision         https://hg.mozilla.org/mozilla-central/rev/1fbc958f75576446a57cf93406db87b51b12911d
Gecko Version          45.0a1
Device Name            flame
Firmware(Release)      4.4.2
Firmware(Incremental)  eng.cltbld.20151029.182818
Firmware Date          Thu Oct 29 18:28:30 EDT 2015
Firmware Version       v18D v4
Bootloader             L1TC000118D0
Status: RESOLVED → VERIFIED
QA Whiteboard: [QAnalyst-Triage-] → [QAnalyst-Triage-][MGSEI-Triage+]
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.