[Simple push] Giving Zero in version during push sends Time stamp as the version# to the app

RESOLVED FIXED

Status

Firefox OS
General
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: swaroopa, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
STR:

Prerequsite:
Register an endpoint for an app.

1. From the terminal enter curl -X  PUT --data 'version=1' <endpoint url>
2. At the app's end observe that version 1 is pushed.
3. Now again from the terminal enter curl -X  PUT --data 'version=0' <endpoint url>
4. Verify the version at the app by the below function

navigator.mozSetMessageHandler('push', function(e) {
    console.log("version:" + e.version);
}

Expected Result:
As 0 is less than 1, the push notification should not be sent to the app.

Actual Result:
The timestamp(epoch) is sent in the version number when 0 is given in the command
 "curl -X  PUT --data 'version=0' <endpoint url>" 
Note that 0 could be pushed any number of times, and every time, a new timestamp is being sent. 

The push server used: push.services.mozilla.com

Updated

4 years ago
Depends on: 822712
Priority: P3 → --
fixed in github rev a865eddee3e9d766f51c2b95cecdf9b8a0fb2769

https://github.com/jrconlin/pushgo/commit/a865eddee3e9d766f51c2b95cecdf9b8a0fb2769

(NOTE: Passing "0" after "1" may cause the client to reject the update as non-sequential.)
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.