-
Notifications
You must be signed in to change notification settings - Fork 332
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
letting web server commit the response naturally #1036
Conversation
Great, @nykolaslima! But I think your PR broke the unit tests 😞 I guess you will probably need to flush the PrintWriter used on the tests manually. |
Yeah! I'm fixing it 😢 |
@csokol done! |
thanks @nykolaslima, this PR seems ok to me! @csokol @lucascs can you guys see any downside by doing this? |
Imagine that: I wrote "ok!" to the response. Didn't flush. Transaction interceptor changes the status code to 500. Flushes. We'll get a 500 error with ok! on the response. We're fixing one bug and creating another one. Maybe a better way to do this is to delay the response actions until after the interceptors run. this is a much bigger change, worthy of a major bump in VRaptor version, but we probably should do this eventually |
I agree with you @lucascs. But the problem that you related already exists. I was talking with @csokol to do exactly what you suggested, delay the write to after the interceptors run. But it will required a huge change in the framework. I think that we are not creating another bug with this PR but we are not solving all bugs (response status and body). What do you think about merging this PR, that solves the response status problem and open a new issue to handle the "delayed response write"? (ps: to workaround the problem with the messages wrote to the response, the interceptor could inject |
👍 |
@Turini can we merge it? |
👌 |
letting web server commit the response naturally
thanx @nykolaslima |
🎉 |
@Turini @csokol this is related to #1035