Closed Bug 1159310 Opened 5 years ago Closed 5 years ago

remember the push count and last push time for push events

Categories

(Core :: DOM: Push Notifications, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: dougt, Assigned: dougt)

Details

Attachments

(2 files)

In order to provide some more information to the user how about push events are being used, I'd like to start remembering the number of pushes and the last push time.
Comment on attachment 8598744 [details] [diff] [review]
0001-Bug-1159310-Remember-the-push-count-and-last-push-ti.patch

Review of attachment 8598744 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good! It'd be nice if the standard `PushEvent` interface exposed this, too.

::: dom/push/PushService.jsm
@@ +1334,5 @@
>            aPushRecord.version < aLatestVersion) {
>          debug("Version changed, notifying app and updating DB");
>          aPushRecord.version = aLatestVersion;
> +        aPushRecord.pushCount = aPushRecord.pushCount + 1;
> +        aPushRecord.lastPush = new Date().getTime();

Noting for the future: this can be set to the `Last-Modified` header value once we switch to Web Push.
Attachment #8598744 - Flags: review?(kcambridge) → review+
sorry had to back this out Doug for test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=9393848&repo=mozilla-inbound
Flags: needinfo?(dougt)
Sorry, I should've caught this in review. Fixed the relevant tests to only compare the fields we care about, instead of using `deepEqual`.
Flags: needinfo?(dougt)
Attachment #8599277 - Flags: review?(dougt)
Attachment #8599277 - Flags: review?(dougt) → review+
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/12e0846f854f
https://hg.mozilla.org/mozilla-central/rev/b995a74f067b
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.