apache / incubator-answer

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

Home Page:https://answer.apache.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite Redirect for Edited Question

calmdev opened this issue · comments

Describe the bug

I edited a question a few times yesterday and noticed that there is an infinite redirect on refresh.

To Reproduce

  1. Go here: https://godev.com/questions
  2. Find the post titled: How do I get started learning Go?
  3. Click it and notice question loads.
  4. 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

Screen.Recording.2024-03-27.at.2.03.08.PM.mov
Screenshot 2024-03-27 at 2 36 17 PM

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.

58dd97a

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.