Fixed ungraceful failure when failing to connect to web server during file upload.
Review Request #9208 — Created Sept. 22, 2017 and submitted
Information | |
---|---|
nicho | |
Review Board | |
release-2.5.x | |
4467 | |
1b7561b... | |
Reviewers | |
reviewboard, students | |
In the Review Request screen, failing to connect to the web server while
uploading a file using the Update -> Add File dialog would result in a
JavaScript error.The server response message is parsed as a JSON object. If the server does
not have a response message, which is the case when the connection to the
web server fails, the JSON object parsed from the response message would be
null, resulting in an error when trying to access members of the object
later.Null checks were added prior to accessing members of the JSON object. This
prevents the JavaScript from simply crashing. A default error message was
added, reading "Unknown Error" if the JSON object is null.With the fix in place, failing to connect to the web server during a file
upload in the Review Request screen displays "Unknown Error", without any
JavaScript errors.
Ran JSTests.
Tested manually by attempting to upload a file while the server was off.
There were no JavaScript errors, and the displayed error message read
"Unknown Error".
Description | From | Last Updated |
---|---|---|
Looks like the wrong summary for this change, and some of the code content? You may not have posted explicitly … |
|
|
Same comments apply about the description/testing as in my other review(s). I'd like to see more about when/why this problem … |
|
|
Oh, this change should also probably be targeting release-2.5.x. |
|
|
The description looks great! Just what we're looking for :) A couple small wording tweaks: "web-server" should be "web server". … |
|
|
Single quotes. This string should be marked for translation with gettext(). |
|
-
-
Looks like the wrong summary for this change, and some of the code content? You may not have posted explicitly this branch, getting the parent branch as well.
-
Same comments apply about the description/testing as in my other review(s). I'd like to see more about when/why this problem occurs and what things look like with the fix in place when it does happen. Something that isn't clear from the description is that this isn't site-wide, and is specific to a certain piece of UI (it sounds like it addresses this across the board).
Change Summary:
Updated descriptions to be more specific, and fixed the code content.
Summary: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 2 (+2 -2) |
Checks run (2 succeeded)
Change Summary:
Fixed grammar, and targetted version release-2.5.x instead.
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Branch: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commit: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+2 -2) |
Checks run (2 succeeded)
-
Looks good to me!
-
reviewboard/static/rb/js/views/uploadAttachmentView.js (Diff revision 3) Single quotes.
This string should be marked for translation with
gettext()
.
Change Summary:
Changed 'Unknown Error' string to single quotes, and used gettext() around it for translations down the line.
Summary: |
|
||||
---|---|---|---|---|---|
Commit: |
|
||||
Diff: |
Revision 4 (+2 -2) |
Checks run (2 succeeded)
Change Summary:
Added a review request dependency.
Depends On: |
|
---|
Change Summary:
Removed the dependency (turns out it wasn't actually dependent).
Depends On: |
|
---|