Sunday, February 12, 2023
2 changes · master
Miscellaneous changes
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the text content as JSON. Most of the time this works, but if the response contains any HTML tags, like `<lambda>` from a Python stacktrace, the JSON response will get misinterpreted as HTML instead of regular text, causing the subsequent JSON interpretation to fail. The end result for the user is
Original PR description
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the…
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the text content as JSON. Most of the time this works, but if the response contains any HTML tags, like `<lambda>` from a Python stacktrace, the JSON response will get misinterpreted as HTML instead of regular text, causing the subsequent JSON interpretation to fail. The end result for the user is that empty tracebacks will be displayed instead of User Errors or actual tracebacks. __Desired behavior:__ The JSON response is HTML escaped before being sent and will therefore be correctly parsed and displayed to the user. __Related:__ - https://github.com/odoo/odoo/pull/109572 and https://github.com/odoo/odoo/pull/110929 were fixing this issue in the frontend. However JS team suggested that it should be fixed in the backend instead since this bug was introduced from https://github.com/odoo/odoo/pull/104594 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#111549 Forward-Port-Of: odoo/odoo#111433
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the text content as JSON. Most of the time this works, but if the response contains any HTML tags, like `<lambda>` from a Python stacktrace, the JSON response will get misinterpreted as HTML instead of regular text, causing the subsequent JSON interpretation to fail. The end result for the user is
Original PR description
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the…
__Description of the issue:__ When something goes wrong while downloading a report file, a 500 error is sent as JSON. However the frontend interprets this response as HTML and then try to parse the text content as JSON. Most of the time this works, but if the response contains any HTML tags, like `<lambda>` from a Python stacktrace, the JSON response will get misinterpreted as HTML instead of regular text, causing the subsequent JSON interpretation to fail. The end result for the user is that empty tracebacks will be displayed instead of User Errors or actual tracebacks. __Desired behavior:__ The JSON response is HTML escaped before being sent and will therefore be correctly parsed and displayed to the user. __Related:__ - https://github.com/odoo/odoo/pull/109572 and https://github.com/odoo/odoo/pull/110929 were fixing this issue in the frontend. However JS team suggested that it should be fixed in the backend instead since this bug was introduced from https://github.com/odoo/enterprise/pull/33443 - https://github.com/odoo/enterprise/pull/35308 also require this PR to be merged since it uses a `RedirectWarning` to work. - Similar PR in community repo https://github.com/odoo/odoo/pull/111433 opw-3131030 opw-3085277 Forward-Port-Of: odoo/enterprise#36564 Forward-Port-Of: odoo/enterprise#36523