Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voting error responses are not rendering to the user #4548

Closed
BrokenEagle opened this issue Jul 12, 2020 · 4 comments
Closed

Voting error responses are not rendering to the user #4548

BrokenEagle opened this issue Jul 12, 2020 · 4 comments
Labels

Comments

@BrokenEagle
Copy link
Collaborator

Neither the note popup nor the console message are appearing. Instead, the "Updating posts (X pending)..." just hangs there indefinitely. I checked and it's sending back the right Javascript, however that Javascript is not running. I'm wondering if it might be because the response is an HTTP 500 response.

Systems tested:

  • Chrome 83.0.4103.116 (64-bit)
  • Firefox 77.0.1 (64-bit)
@BrokenEagle
Copy link
Collaborator Author

BrokenEagle commented Jul 13, 2020

I just checked my instance which is still running commit fde6e39 and it is doing the error responses just fine, i.e. both the Javascript is working and the response is also an HTTP 500, so it doesn't have anything to do with the HTTP code.

I noticed this problem just recently within the last week, and there are only about a week of new commits since my instance which seems to confirm that.

Commits comparison: fde6e39...1cef3bf

Edit:

Yeah, I just upgraded my instance to the latest version, and now it is experiencing the same error.

@BrokenEagle
Copy link
Collaborator Author

Alright, I rebased the commits back and forth, and I was able to narrow down that it's commit 1760d1f which is causing the problem. With commit
efe5111 where jQuery is bundled with Webpack it still works, but on 1760d1f where jQuery was upgraded to 3.5.1 it no longer works. I don't know why that jQuery version is causing issues though...???

@BrokenEagle
Copy link
Collaborator Author

https://blog.jquery.com/2020/04/10/jquery-3-5-0-released/

One bug worth highlighting is a bug we fixed in the Ajax script transport. jQuery used to evaluate any response to a request for a script as a script, which is not always the desired behavior. This is different than other data types where such a convention was fine (e.g. in the case of JSON). jQuery 3.5.0 will now only evaluate successful HTTP responses.

So it looks like this was done intentionally in jQuery 3.5.0. This means that we can no longer send Javascript responses for errors and expect them to evaluate. If we want this to still work as before, we'll have to change errors to use a 2xx HTTP status code for network calls on all Javascript endpoints.

@BrokenEagle
Copy link
Collaborator Author

Closing because votes through the tag script function no longer error out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant