Title-change for failure provides un-parseable json
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Software Center Agent |
Fix Released
|
Low
|
Michael Nelson |
Bug Description
In current trunk, when reporting a failed purchase, the returned JSON isn't JSON (as it is missing a comma):
It looks like this was introduced while adding the user_cancelled property. It's unfortunate that it's quite difficult for us to test reliably, given that our test runner doesn't execute JS.
Also, there is an inconsistency between: false and "False" being returned as values for different attributes ('successful' and 'user_cancelled' respectively). Looking at the SC code which does parsed_
STR:
(Note: I assume this is also reproducible with the SC client, but steps here aren't dependent on the client - feel free to update)
1) Access https:/
2) Use your browsers javascript debugger to copy the title (ie. for me it was: { "successful" : false, "failures" : "Error while checking or creating a LP person: [Errno 111] Connection refused" "user_cancelled" : "False"}
3) In your JS debugger try to eval your json: eval({ "successful" : false, "failures" : "Error while checking or creating a LP person: [Errno 111] Connection refused" "user_cancelled" : "False"}) - you'll get a syntax error. Add a comma before "user_cancelled" and it will work.
description: | updated |
Changed in software-center-agent: | |
status: | New → Fix Committed |
Changed in software-center-agent: | |
importance: | Undecided → Low |
tags: | added: kb-defect sp-1 |
Changed in software-center-agent: | |
status: | Fix Committed → Fix Released |
QA step output for the VPS:
1) Accessed: http:// 173.212. 255.144/ subscriptions/ en/ubuntu/ maverick/ +new/?archive_ id=mvo/ private- test&arch= i386 and was redirected to payment screen. django_ project payment- notifications --include- paymentinitiate d {"successful" : false, "failures": "", "user_cancelled": true}</title> (ie. it's now parsable, and the boolean value is a json boolean, rather than a string).
2) Cancelled the payment (which took a while?),
3) Ran the following on the server::
$ cd /home/hudson/
$ sudo ./manage.py process-
4) Watched the browser tab which ended up with the following in its title: <title>{ "successful" : false, "failures" : "" "user_cancelled" : "True"}</title> (which is un-parsable).
5) Deployed the new version to the VPS (with r242)
6) Went back to the browser tab and reloaded the subscription, which showed the correct title json: <title>