rakanalh / django-pushy

Your push notifications handled at scale.
MIT License
168 stars 16 forks source link

Urgent about the JSON payload method #14

Closed wolfhechel closed 9 years ago

wolfhechel commented 9 years ago

As we're using the JSON request method in production we've experienced an issue with the return data from json_request. While plain_request always returns the canonical id the json_request has been seen to return a JSON structure with the canonical inside.

With the device.key = canonical update, we end up with keys being saved like:

{'errors': defaultdict(<type 'list'>, {u'InternalServerError': [u'{\'errors\': defaultdict(<type \'list\'>, {u\'InternalServerError\': [u\'{\\\'errors\\\': defaultdict(<type \\\'list\\\'>, {u\\\'InternalServerError\\\': [u\\\'{\\\\\\\'errors\\\\\\\': defaultdict(<type \\\\\\\'list\\\\\\\'>, {u\\\\\\\'InternalServerError\\\\\\\': [u\\\\\\\'{\\\\\\\\\\\\\\\'errors\\\\\\\\\\\\\\\': defaultdict(<type \\\\\\\\\\\\\\\'list\\\\\\\\\\\\\\\'>, {u\\\\\\\\\\\\\\\'InternalServerError\\\\\\\\\\\\\\\': [u\\\\\\\\\\\\\\\'{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'errors\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\': defaultdict(<type \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'list\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'>, {u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'InternalServerError\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\': [u"{\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'canonical\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\': {u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'real_token\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\': u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'real_token\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'}}"]})}\\\\\\\\\\\\\\\']})}\\\\\\\']})}\\\']})}\']})}']})}

I'm working on a fix for this as I'm writing this and will do a PR as soon as I've isolated the issue and implemented a handling method for this.

Meanwhile you should not submit the current master to PIP.

rakanalh commented 9 years ago

Version 0.1.7 uploaded