Closed Bug 917465 Opened 11 years ago Closed 11 years ago

[Email] launching a mail notification will cause Email app to spin and load forever

Categories

(Firefox OS Graveyard :: Gaia::E-Mail, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+, b2g-v1.2 verified)

VERIFIED FIXED
blocking-b2g koi+
Tracking Status
b2g-v1.2 --- verified

People

(Reporter: tchung, Assigned: jrburke)

Details

Attachments

(2 files)

when tapping the incoming mail notification, it tends to launch into email app but just sit there and spin forever, never loading the content on the screen.   Attached a full logcat.

Tried this with both a gmail and yahoo IMAP account.   Full logcat attached.

Repro:
1) install 1.2 nightly build 
2) setup yahoo and/or gmail accounts.  set up receive notifications, and shorten the sync interval.
3) send emails to both accounts from other sources
4) new email notifications appear.  open status bar and tap on it.
5) Verify it sits and spins forever trying to launch the email that you want to view.  it never actually loads.

Expected:
- email is opened on notifications and viewed in app

ActuL;
- email never launches, the app just spins forever
triage: blocking for bug on new 1.2 feature
blocking-b2g: koi? → koi+
blocking-b2g: koi+ → koi?
Evan, did you intentionally remove the koi+ for this bug?
Flags: needinfo?(evanxd)
Hi Dylan,

Sorry, it might be an accident.
I didn't know I did that.
Flags: needinfo?(evanxd)
blocking-b2g: koi? → koi+
Assignee: nobody → jrburke
Dylan Oliver deleted the linked story in Pivotal Tracker
Comment on attachment 811410 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/12523

The issue was my poor understanding of notification API: it triggers mozSetMessageHandler listeners for every notification closed. So what was happening:

* email is sent to two email addresses, both configured to be syncing messages.
* this results in two notifications, one for each account.
* one notification is clicked.
* due to an implementation detail in the system notification code, it also then closes all notifications for associated with the app that gets the notification click.
* This results in the system firing three events to the 'notification' message handler in the email app: one for the click and two close notifications.

I should have been checking message.clicked to know if the message handler notification was from a click or a close, and not do the goofy notifyId checking I was doing before. The notifyId checking was added because I saw to message handler events when testing with one account configured. Turns out the second was the "onclose" message. The notifyId setup was not sufficient with these three events because the third event is for a close of an unrelated notification. This caused the bug.

So the fix is: check for message.clicked, and only do work in those cases. I then removed the hacky notifyId stuff, and then updated the integration test to pass .clicked to operate correctly. I also fixed a bad assumption in email_sync test code, and updated the tests to use email_sync's setup() to do the message handler mock injection.
Attachment #811410 - Flags: review?(bugmail)
Comment on attachment 811410 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/12523

r=asuth based on inspection and green travis run and minimal deltas.  Experiencing device issues so I haven't run on the device and jrburke has indicated he ran device tests, so I think we're good.
Attachment #811410 - Flags: review?(bugmail) → review+
Merged in Gaia master:
https://github.com/mozilla-b2g/gaia/commit/94d358f8cb17fdbcf9fc0c0392e393677db8af6d

from pull request:
https://github.com/mozilla-b2g/gaia/pull/12523
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Uplifted 94d358f8cb17fdbcf9fc0c0392e393677db8af6d to:
v1.2: 669e9ed9016eb91bb89b6793578cd72537578791
Multiple notifications displayed in notification window, when one notification is selected user is taken to the selected email message. All email account notifications, for this email message, are also satisfied from this single selection for all email accounts. 

Tested with email set-up for yahoo, gmail, hotmail, and outlook in auto/manual setup methods.

Buri v1.2 Mozilla RIL
Gaia   922de46ad5e4a8b513b24233a7f3bc54b93e9612
SourceStamp 2664ac296982
BuildID 20131018004000
Version 26.0a2
Base Image: 20131015
--------- Change the status to "VERIFIED" ---------
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: