Closed Bug 926004 Opened 11 years ago Closed 8 years ago

sending non http put data to pushEndpoint results in multiple values in push.registrations()

Categories

(Core :: DOM: Push Subscriptions, defect)

23 Branch
ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: edwong, Unassigned)

Details

I'm on b2g inari with 1.3 10/1/13 build
1. install jsmith's push app:

2. click install
3. open app off homescreen
4. click register
5. run adb logcat and copy endpoint from output
6. in a shell run this, send an non HTTP PUT to the endpoint:
curl -X POST --data 'version=123' <ENDPOINT_FROM_LOGCAT>
7. click 'refresh registrations'

actual: you'll see 2 endpoints, 1 with version=epoch time and 1 with version = null

expected: you should see 1 endpoint version=null
Seems like the production server doesn't even allow POST. What server are you using to test this. It seems really unlikely that this is a client side issue.
Flags: needinfo?(edwong)
here's the curl:
curl -X PUT --data 'version=32345' https://updates.push.services.mozilla.com/update/tTiJFM4nKjmkgGzSLxfvn7upBJvLcugJvgYZ7NfDtwGSkiVuRxUuEQ1egtVUshYPT221Ez4bjEv1WgaXsLcKF-tRmem9jKRnllAVDnPMSOeR-bZdvQ==

I believe Jason's app, uses the default push server.
Flags: needinfo?(edwong)
Trying this out with my local server, I am unable to do anything aside from PUT the data. POST correctly returns a 405. 

Trying to post to the URL in comment 3 also returns a 405. 

Can you provide the wss:// access point you're hitting so I can probe?
Flags: needinfo?(edwong)
I'm still repro'ing this.  logcat isn't printing wss:// path for me.  It uses the default on b2g which is push.services.mozilla.com i thought.  The curl to post is actually:

curl --data 'version=123' <ENDPOINT>

here's my logcat:
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:11 in registerEndPoint: navigator.push.register is called
E/GeckoConsole(  111): [JavaScript Error: "push.services.mozilla.com : server does not support RFC 5746, see CVE-2009-3555"]
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:15 in registerEndPoint/request.onsuccess: register success fired with endpoint: https://updates.push.services.mozilla.com/update/v2HCqx1K7Cv6ckmGCZmTIrKygc4gOt9fj4ihpnvtskiDlrMhVNAC6Gq8SGWJHVbPLYdyNZ4-3KbEaRH5q-WawV_IjQ4vwdRnUOlbKcSupoBwT-wGDg==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:50 in updateCurrentRegistrations: Retrieve current registrations
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:58 in updateCurrentRegistrations/registrationsResult.onsuccess: End point: https://updates.push.services.mozilla.com/update/v2HCqx1K7Cv6ckmGCZmTIrKygc4gOt9fj4ihpnvtskiDlrMhVNAC6Gq8SGWJHVbPLYdyNZ4-3KbEaRH5q-WawV_IjQ4vwdRnUOlbKcSupoBwT-wGDg==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:59 in updateCurrentRegistrations/registrationsResult.onsuccess: Version: null
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:2 in handlePushMessage: push message received
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:3 in handlePushMessage: endpoint: https://updates.push.services.mozilla.com/update/v2HCqx1K7Cv6ckmGCZmTIrKygc4gOt9fj4ihpnvtskiDlrMhVNAC6Gq8SGWJHVbPLYdyNZ4-3KbEaRH5q-WawV_IjQ4vwdRnUOlbKcSupoBwT-wGDg==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:4 in handlePushMessage: version: 123
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:59 in updateCurrentRegistrations/registrationsResult.onsuccess: Version: null
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:2 in handlePushMessage: push message received
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:3 in handlePushMessage: endpoint: https://updates.push.services.mozilla.com/update/v2HCqx1K7Cv6ckmGCZmTIrKygc4gOt9fj4ihpnvtskiDlrMhVNAC6Gq8SGWJHVbPLYdyNZ4-3KbEaRH5q-WawV_IjQ4vwdRnUOlbKcSupoBwT-wGDg==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:4 in handlePushMessage: version: 123123
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:50 in updateCurrentRegistrations: Retrieve current registrations
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:58 in updateCurrentRegistrations/registrationsResult.onsuccess: End point: https://updates.push.services.mozilla.com/update/v2HCqx1K7Cv6ckmGCZmTIrKygc4gOt9fj4ihpnvtskiDlrMhVNAC6Gq8SGWJHVbPLYdyNZ4-3KbEaRH5q-WawV_IjQ4vwdRnUOlbKcSupoBwT-wGDg==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:59 in updateCurrentRegistrations/registrationsResult.onsuccess: Version: 123123
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:58 in updateCurrentRegistrations/registrationsResult.onsuccess: End point: https://updates.push.services.mozilla.com/update/Pwb_kM1I2TfsmQtldGhW4ykn8FzPDuWnX3hSoMbBeFATPMBn1kOR4AYWbiXzKkkVv4KkBg57qtcQZzm_KWYWKoB_PBHUccd-WS8-BxnQ4ywnAYKDRw==
E/GeckoConsole( 1214): Content JS LOG at http://mozqa.com/qa-testcase-data/webapi/simplepush/push.js:59 in updateCurrentRegistrations/registrationsResult.onsuccess: Version: null
Flags: needinfo?(edwong)
Closing this out because Simple Push is deprecated, and the new server uses POST for Web Push.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.