Closed
Bug 851253
Opened 12 years ago
Closed 12 years ago
SimplePush: Only wake up registered applications using push-register
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18+ fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix)
People
(Reporter: nsm, Assigned: nsm)
References
Details
Attachments
(1 file, 2 obsolete files)
3.39 KB,
patch
|
nsm
:
review+
akeybl
:
approval-mozilla-b2g18+
|
Details | Diff | Splinter Review |
Broadcasting a system message has two drawbacks:
1) It could end up launching 10-20 push enabled apps at the same time, putting serious load on the system. Have a staggered wake up.
2) Don't start push enabled apps unless they actually have active registrations which will need to be refreshed. Apps that've never run or never acquired an endpoint, or no longer have active endpoints should not be started.
Assignee | ||
Comment 1•12 years ago
|
||
@Marcelino, input from Telefonica is welcome here. I'm going to fix this after 822712 lands, only if it is shown to be a problem
Comment 2•12 years ago
|
||
@Nikhil I have added Telefonica push guys in CC, so they can give you some feedback, better than me :-)
Assignee | ||
Comment 3•12 years ago
|
||
Assignee | ||
Comment 4•12 years ago
|
||
Attachment #728496 -
Attachment is obsolete: true
Attachment #733618 -
Flags: review?(justin.lebar+bug)
Comment 5•12 years ago
|
||
Comment on attachment 733618 [details] [diff] [review]
only push-register applications with registrations
To be clear, this patch does not appear to stagger the wakeup. Which is fine.
Attachment #733618 -
Flags: review?(justin.lebar+bug) → review+
Comment 6•12 years ago
|
||
Oops, I had review comments!
r=me with some nits.
>+ this._db.getAllChannelIDs(function(records) {
>+ this._notifyAllAppsRegister(records);
>+ this._dropRegistrations()
>+ .then(finishHandshake.bind(this));
Nit: I know this is inconsisent with how you did it when the .then() was a
multiline clause, but here it would match our style if you moved the "." in
".then" to align with the "." in the line above.
>@@ -804,21 +796,41 @@ PushService.prototype = {
> debug("Could not get channelID " + aChannelIDFromServer + " from DB");
> }
>
> this._db.getByChannelID(aChannelID,
> compareRecordVersionAndNotify.bind(this),
> recoverNoSuchChannelID.bind(this));
> },
>
>- _notifyAllAppsRegister: function() {
>+ // Fires a push-register system message to all applications that have
>+ // registrations.
>+ _notifyAllAppsRegister: function(records) {
Can you please explain in the comment what |records| is supposed to be? Or
even better: Can we make this function take no arguments and return a promise?
So you'd do something like
this._notifyAllAppsRegister()
.then(this._dropRegistrations.bind(this))
.then(finishHandshake.bind(this));
> debug("notifyAllAppsRegister()");
> let messenger = Cc["@mozilla.org/system-message-internal;1"]
> .getService(Ci.nsISystemMessagesInternal);
>- messenger.broadcastMessage('push-register', {});
>+
>+ // Pages to be notified.
>+ // wakeupTable[manifestURL] -> [ pageURL ]
>+ var wakeupTable = {};
>+ for (var i = 0; i < records.length; i++) {
>+ var record = records[i];
>+ if (!wakeupTable[record.manifestURL])
Nit: It's equivalent in this case, but it would be more idiomatic to do |if
(record.manifestURL in wakeupTable)|.
Assignee | ||
Comment 7•12 years ago
|
||
Carrying forward r+ from jlebar and landing.
Convert notifyAllAppsRegister() to promises and fix nits.
Attachment #733618 -
Attachment is obsolete: true
Attachment #735414 -
Flags: review+
Assignee | ||
Comment 8•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/01ffdd61fd94
Marking as [leave open] since part 1 of bug description hasn't been fixed.
Whiteboard: [leave open]
Comment 9•12 years ago
|
||
> Marking as [leave open] since part 1 of bug description hasn't been fixed.
Would you mind taking care of that in a separate bug? Combining landings into multiple bugs often makes it really confusing to understand what's going on, particularly when uplifts are involved.
Assignee | ||
Updated•12 years ago
|
Summary: Smarter application wake up on push notification push-register message → SimplePush: Only wake up registered applications using push-register
Whiteboard: [leave open]
Assignee | ||
Comment 10•12 years ago
|
||
Filed bug 860041 for additional improvements.
Comment 11•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•12 years ago
|
status-b2g18:
--- → affected
tracking-b2g18:
--- → ?
Updated•12 years ago
|
Assignee | ||
Comment 12•12 years ago
|
||
Comment on attachment 735414 [details] [diff] [review]
only push-register applications with registrations
NOTE: 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 #): 822712 Push Notifications
User impact if declined:
Low impact while push has low usage. But if a user installs many applications with push notifications, they'll have a lot more background apps running when notifications arrive, unless this patch is applied.
Testing completed:
Yes
Risk to taking this patch (and alternatives if risky):
None as long as push is disabled.
String or UUID changes made by this patch:
None
Attachment #735414 -
Flags: approval-mozilla-b2g18?
Updated•12 years ago
|
Attachment #735414 -
Flags: approval-mozilla-b2g18? → approval-mozilla-b2g18+
Comment 13•12 years ago
|
||
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•