incubator-answer
incubator-answer copied to clipboard
Infinite Redirect for Edited Question
Describe the bug
I edited a question a few times yesterday and noticed that there is an infinite redirect on refresh.
To Reproduce
- Go here: https://godev.com/questions
- Find the post titled: How do I get started learning Go?
- Click it and notice question loads.
- Refresh the page and note an infinite redirect
Also note if you view other questions refreshing the page doesn't have the same redirect issue.
Expected behavior
Refreshing page for an edited question doesn't result in infinite redirect? I haven't had a chance to dig into it more yet. Or compare by editing other posts. Sharing here incase someone has seen it or might have an idea.
Screenshots
https://github.com/apache/incubator-answer/assets/461249/95ff7d28-4e07-4e98-8a56-4865880d761f
Platform
- Device: Mac Book Air, 2022
- OS: MacOS Sonoma 14.4
- Browser and version: Brave – Version 1.64.109 Chromium: 123.0.6312.58 (Official Build) (arm64)
- Version: 1.20
FWIW, I just made a couple edits on this post as well and it seems fine: https://godev.com/questions/10010000000000231/alternate-of-io-readall
Still not exactly sure what's different about the one in my video and original post.
@calmdev Thank you very much for your feedback. We have found the cause and are checking to see if there are other similar issues. Furthermore, we will fix this issue ASAP.
Awesome, I'll keep an eye out for the patch.
@LinkinStars
hmmm... very interesting bug. what is the issue?
@LinkinStars
hmmm... very interesting bug. what is the issue?
@zahash This is caused by the fact that there is a question mark(?) in the title of the question. So, I'm still testing to see if there are any other special characters that could cause this problem. 🧐
The loop is
/questions/:questionID/:questionTitle
->
/questions/:questionID/:questionTitle/:answerID(not exist)
->
/questions/:questionID/:questionTitle
Because the /questions/:questionID/:answerID is also a correct path. We need to identify if the questionTitle is a title or answerID. In this circumstances, It's a parsing error.
Are there specific steps or sequence of actions required to cause it?
I still haven't seen it for any other questions with (?) in the title.
In the video & screenshot what is the second id in path that is append to URL – a revision number or something?
Are there specific steps or sequence of actions required to cause it?
I still haven't seen it for any other questions with (?) in the title.
https://github.com/apache/incubator-answer/commit/58dd97ac2a6f5b17fd767aefff7e452cb10261c4
It's probably not just the special symbols that causes this problem. My final solution was to make sure that the correct answer ID must exist.
In the video & screenshot what is the second id in path that is append to URL – a revision number or something?
This is the wrong AnswerID that lead to the infinite redirect.