Closed
Bug 963130
Opened 11 years ago
Closed 11 years ago
NotificationDB throws with missing this.byTag[origin]
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: gerard-majax, Assigned: mikehenrty)
References
Details
(Whiteboard: [systemsfe][p=3])
Attachments
(1 file)
1.53 KB,
patch
|
gwagner
:
review+
fabrice
:
approval-mozilla-b2g28+
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•11 years ago
|
||
From bug 962977, we learned that:
- start emulator
- send a wappush message:
- telnet localhost 5554
- sms pdu 07911326040000F0400B911346610089F6000420806291731408350605040B8423F0010603AEAF8203056A0045C60D036F7265696C6C7900850103436865636B20746869732077656273697465000101
Will in some case trigger an exception in NotificationDB.jsm:
I/Gecko ( 308): *************************
I/Gecko ( 308): A coding exception was thrown in a Promise resolution callback.
I/Gecko ( 308):
I/Gecko ( 308): Full message: TypeError: this.byTag[origin] is undefined
I/Gecko ( 308): See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
I/Gecko ( 308): Full stack: NotificationDB.taskSave@resource://gre/modules/NotificationDB.jsm:255
I/Gecko ( 308): NotificationDB.runNextTask/<@resource://gre/modules/NotificationDB.jsm:220
I/Gecko ( 308): onSuccess@resource://gre/modules/NotificationDB.jsm:61
I/Gecko ( 308): Handler.prototype.process@resource://gre/modules/Promise.jsm:767
I/Gecko ( 308): this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm:531
I/Gecko ( 308):
I/Gecko ( 308): *************************
To my understanding, this happens when:
- you have sent a previous notification to the same app, that has not been closed
- restart b2g
- send a new notification to this application
As far as I understand, the this.byTag map is not populated when there is already some notificationstore.json
Reporter | ||
Comment 2•11 years ago
|
||
First run, fresh profile:
I/Gecko ( 45): -*- NotificationDB component: Task, saving
I/Gecko ( 45): -*- NotificationDB component: Task: notifications={}
I/Gecko ( 45): -*- NotificationDB component: Task: origin="app://wappush.gaiamobile.org/manifest.webapp"
I/Gecko ( 45): -*- NotificationDB component: Task: notifications[origin]=undefined
I/Gecko ( 45): -*- NotificationDB component: Task: this.byTag[origin]={}
Then, stop and start b2g (keeping the profile, not closing the notification):
I/Gecko ( 285): -*- NotificationDB component: Task, saving
I/Gecko ( 285): -*- NotificationDB component: Task: notifications={"app://wappush.gaiamobile.org/manifest.webapp":{"{84e795b0-7134-4bcb-81cc-9f90fc6105b5}":{"id":"{84e795b0-7134-4bcb-81cc-9f90fc6105b5}","title":"+31641600986","dir":"auto","lang":"","body":"Check this website http://www.oreilly.com/","tag":"1390493982425","icon":"app://wappush.gaiamobile.org/style/icons/wappush.png"}}}
I/Gecko ( 285): -*- NotificationDB component: Task: origin="app://wappush.gaiamobile.org/manifest.webapp"
I/Gecko ( 285): -*- NotificationDB component: Task: notifications[origin]={"{84e795b0-7134-4bcb-81cc-9f90fc6105b5}":{"id":"{84e795b0-7134-4bcb-81cc-9f90fc6105b5}","title":"+31641600986","dir":"auto","lang":"","body":"Check this website http://www.oreilly.com/","tag":"1390493982425","icon":"app://wappush.gaiamobile.org/style/icons/wappush.png"}}
I/Gecko ( 285): -*- NotificationDB component: Task: this.byTag[origin]=undefined
I/Gecko ( 285): *************************
I/Gecko ( 285): A coding exception was thrown in a Promise resolution callback.
I/Gecko ( 285):
I/Gecko ( 285): Full message: TypeError: this.byTag[origin] is undefined
I/Gecko ( 285): See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
I/Gecko ( 285): Full stack: NotificationDB.taskSave@resource://gre/modules/NotificationDB.jsm:261
I/Gecko ( 285): NotificationDB.runNextTask/<@resource://gre/modules/NotificationDB.jsm:225
I/Gecko ( 285): onSuccess@resource://gre/modules/NotificationDB.jsm:61
I/Gecko ( 285): Handler.prototype.process@resource://gre/modules/Promise.jsm:767
I/Gecko ( 285): this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm:531
I/Gecko ( 285):
I/Gecko ( 285): *************************
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → mhenretty
Whiteboard: [systemsfe]
Updated•11 years ago
|
Component: General → DOM
Updated•11 years ago
|
Blocks: b2g-notifications
Assignee | ||
Comment 4•11 years ago
|
||
This seems to do the trick. I pushed to try, and am going to bang on it for a while using the QA page:
http://mozilla.github.io/qa-testcase-data/webapi/notifications/
https://tbpl.mozilla.org/?tree=Try&rev=4a4db178bb4f
Assignee | ||
Updated•11 years ago
|
Whiteboard: [systemsfe] → [systemsfe][p=3]
Target Milestone: --- → 1.3 C3/1.4 S3(31jan)
Reporter | ||
Comment 5•11 years ago
|
||
I do confirm that this patch fixes the exposed issue when testing in emulator :)
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 8364630 [details] [diff] [review]
Populate byTag on DB reload
Try looks good. Alex, care to review?
Attachment #8364630 -
Flags: review?(lissyx+mozillians)
Updated•11 years ago
|
Attachment #8364630 -
Flags: review?(lissyx+mozillians) → review+
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•11 years ago
|
||
Now that this has landed, it also fixes SMS notification issues :)
Reporter | ||
Comment 10•11 years ago
|
||
This is missing from the Gecko 28 of 1.3
Flags: needinfo?(mhenretty)
Reporter | ||
Comment 11•11 years ago
|
||
Comment on attachment 8364630 [details] [diff] [review]
Populate byTag on DB reload
NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
User impact if declined: huge breakage of the new notification API
Testing completed: this patch has been on master since early february and helped fixing a lot of notifications issues related to the new API
Risk to taking this patch (and alternatives if risky): low, the fix is quite short and self contained
String or UUID changes made by this patch: none
Attachment #8364630 -
Flags: approval-mozilla-b2g28?
Comment 12•11 years ago
|
||
Comment on attachment 8364630 [details] [diff] [review]
Populate byTag on DB reload
a- - see blocking bug for more details
Attachment #8364630 -
Flags: approval-mozilla-b2g28? → approval-mozilla-b2g28-
Reporter | ||
Updated•11 years ago
|
Attachment #8364630 -
Flags: approval-mozilla-b2g28-
Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 8364630 [details] [diff] [review]
Populate byTag on DB reload
NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
User impact if declined: New Notification API broken, NotificationDB will throw and break at use.
Testing completed: in master since end of january, fixes a lot of bugs
Risk to taking this patch (and alternatives if risky): low
String or UUID changes made by this patch: none
I'm renominating since without this patch, the notification API is not usable on gecko 28 for b2g
Attachment #8364630 -
Flags: approval-mozilla-b2g28?
Comment 14•11 years ago
|
||
If you are asking uplift here, then you need a 1.3+. We don't grant blanket approval anymore without 1.3+.
Reporter | ||
Comment 15•11 years ago
|
||
requesting 1.3? as it breaks Notification API.
blocking-b2g: --- → 1.3?
Comment 16•11 years ago
|
||
Comment on attachment 8364630 [details] [diff] [review]
Populate byTag on DB reload
Review of attachment 8364630 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/src/notification/NotificationDB.jsm
@@ +58,5 @@
> if (DEBUG) { debug("Unable to parse file data " + e); }
> }
> + // populate the list of notifications by tag
> + if (this.notifications) {
> + for (var origin in this.notifications) {
s/var/let
@@ +61,5 @@
> + if (this.notifications) {
> + for (var origin in this.notifications) {
> + this.byTag[origin] = {};
> + for (var id in this.notifications[origin]) {
> + var curNotification = this.notifications[origin][id];
s/var/let
Attachment #8364630 -
Flags: approval-mozilla-b2g28? → approval-mozilla-b2g28+
Comment 17•11 years ago
|
||
status-b2g-v1.3:
--- → fixed
status-b2g-v1.4:
--- → fixed
status-firefox27:
--- → wontfix
status-firefox28:
--- → wontfix
status-firefox29:
--- → fixed
Flags: needinfo?(mhenretty)
Updated•11 years ago
|
blocking-b2g: 1.3? → 1.3+
Updated•11 years ago
|
status-b2g-v1.3T:
--- → fixed
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•