Closed
Bug 910915
Opened 11 years ago
Closed 11 years ago
[shell.js] New style notifications don't trigger system messages
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(blocking-b2g:koi+, firefox26 fixed)
Tracking | Status | |
---|---|---|
firefox26 | --- | fixed |
People
(Reporter: jlal, Assigned: qdot)
References
Details
(Whiteboard: [systemsfe])
Attachments
(3 files, 3 obsolete files)
(deleted),
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
fabrice
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
julienw
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Updated•11 years ago
|
Summary: ' → [shell.js] New style notifications don't trigger system messages
Reporter | ||
Comment 1•11 years ago
|
||
Pointer to Github pull-request
Reporter | ||
Comment 2•11 years ago
|
||
Comment on attachment 797565 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/11850
So I would clean this up but I wanted to submit something that was failing that _should_ work for this case.
Attachment #797565 -
Flags: feedback?(kyle)
Comment 3•11 years ago
|
||
Email is currently using notification_helper, but we want to switch to the `new Notification` model for email notifications so that tags for notifications for updates work (bug 892522 -- a top priority feature for v1.2). However, this issue is preventing the switch since clicking on the notification generated by `new Notification` does not seem to result in the email app getting a signal that the notification was clicked.
For email, it does not bind an onclick or onclose handler, but relies on the listener passed to navigator.mozSetMessageHandler('notification', ...) to receive events about activations via a notification.
Blocks: 892522
Assignee | ||
Comment 4•11 years ago
|
||
Looks good to me.
Assignee | ||
Updated•11 years ago
|
Attachment #797565 -
Flags: feedback?(kyle) → feedback+
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → kyle
Assignee | ||
Comment 5•11 years ago
|
||
In shell.js line 687, the handleEvent function of AlertsHelper, we only trigger apps opening for old notifications. We need to cleanup the handling for this to deal with both old and new notifications.
Updated•11 years ago
|
blocking-b2g: --- → koi?
Assignee | ||
Comment 6•11 years ago
|
||
There's also a change this collides with bug 908978
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Comment 8•11 years ago
|
||
Getting the following error when trying to send system messages when notifications created with new API are tapped:
[Exception... "Component returned failure code: 0x804b000a (NS_ERROR_MALFORMED_URI) [nsIIOService.newURI]" nsresult: "0x804b000a (NS_ERROR_MALFORMED_URI)" location: "JS frame :: chrome://browser/content/shell.js :: alert_handleEvent :: line 707" data: no]
This relates to the following call:
gSystemMessenger.sendMessage("notification", {
clicked: (detail.type === "desktop-notification-click"),
title: listener.title,
body: listener.text,
imageURL: listener.imageURL
},
Services.io.newURI(listener.target, null, null),
Services.io.newURI(listener.manifestURL, null, null)
);
Both listener.target and listener.manifestURL are undefined here.
Assignee | ||
Comment 9•11 years ago
|
||
This patch mostly works. The only problem is detecting whether we need to send a system message or just ping the observer. The check for listener.mm in shell.js line ~733 doesn't seem to work for new style notifications.
Attachment #799269 -
Attachment is obsolete: true
Comment 10•11 years ago
|
||
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #9)
> This patch mostly works. The only problem is detecting whether we need to
> send a system message or just ping the observer. The check for listener.mm
> in shell.js line ~733 doesn't seem to work for new style notifications.
What about doing it the way Desktop Notifications work, which is ping the observer first and if that throws an exception (meaning the app is closed), then send the system message to wake it up?
Comment 11•11 years ago
|
||
qDot, did you verified with your code the "Notification.close()" is working? I remeber that I've tested it when I was debuging in bug https://bugzilla.mozilla.org/show_bug.cgi?id=908978 and using the nsIAppNotificationService.
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #800495 -
Attachment is obsolete: true
Attachment #801658 -
Flags: review?(fabrice)
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #801659 -
Flags: review?(fabrice)
Assignee | ||
Comment 14•11 years ago
|
||
This will have to land without integration tests, as the way we see if an app is open (checking the validity of the message manager for the process) only works in OOP, which we can't do on desktop. I've added manual tests to the UI test.
Updated•11 years ago
|
Component: Gaia → General
Updated•11 years ago
|
Blocks: b2g-notifications
Assignee | ||
Comment 15•11 years ago
|
||
Adding a UI test since we can't test with integration yet. Note this test will also only work on the phone.
Attachment #802228 -
Flags: review?(felash)
Comment 16•11 years ago
|
||
Comment on attachment 802228 [details] [diff] [review]
Patch 3 (v1) - Gaia UI Test for Notification App Opening
r=me with the github comments addressed
Attachment #802228 -
Flags: review?(felash) → review+
Assignee | ||
Comment 17•11 years ago
|
||
Comment on attachment 797565 [details]
Pointer to Github pull request: https://github.com/mozilla-b2g/gaia/pull/11850
Obsoleting for now, as this breaks on desktop due to OOP issues.
Attachment #797565 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #801658 -
Flags: review?(fabrice) → review+
Comment 18•11 years ago
|
||
Comment on attachment 801659 [details] [diff] [review]
Patch 2 (v1) - Add capabilities for new notifications to b2g shell/alertsservice
Review of attachment 801659 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/chrome/content/shell.js
@@ +731,5 @@
> + try {
> + listener.observer.observe(null, topic, listener.cookie);
> + } catch (e) { }
> + }
> + else {
nit: } else {
::: b2g/components/AlertsService.js
@@ +73,5 @@
> + if(aId == "") {
> + uid = "app-notif-" + uuidGenerator.generateUUID();
> + } else {
> + uid = aId;
> + }
Replace by:
let uid = (aId == "") ? "app-notif-" + uuidGenerator.generateUUID() : aId;
@@ +75,5 @@
> + } else {
> + uid = aId;
> + }
> +
> + dump("UID IS " + uid + "\n");
Nit: remove that.
Attachment #801659 -
Flags: review?(fabrice) → review+
Comment 19•11 years ago
|
||
(In reply to Kyle Machulis [:kmachulis] [:qdot] from comment #17)
> Comment on attachment 797565 [details]
> Pointer to Github pull request:
> https://github.com/mozilla-b2g/gaia/pull/11850
>
> Obsoleting for now, as this breaks on desktop due to OOP issues.
Note that we are turning on OOP on b2g desktop Linux in bug 914584.
Assignee | ||
Comment 20•11 years ago
|
||
Assignee | ||
Comment 22•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 23•11 years ago
|
||
Updated•11 years ago
|
Whiteboard: [systemsfe]
Comment 24•11 years ago
|
||
This probably doesn't work :)
cf https://github.com/mozilla-b2g/gaia/commit/128694d47338554b1350221255ca7729a39b2155#commitcomment-4085947
Comment 25•11 years ago
|
||
I mean, the Gaia UITests patch.
Assignee | ||
Comment 26•11 years ago
|
||
Worked fine for me on my phone?
Updated•11 years ago
|
blocking-b2g: koi? → koi+
Updated•11 years ago
|
status-firefox26:
--- → fixed
Target Milestone: --- → 1.2 FC (16sep)
Comment 27•11 years ago
|
||
Verified per completion of initial test pass.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in
before you can comment on or make changes to this bug.
Description
•