LinkinStars commented on PR #1070: URL: https://github.com/apache/incubator-answer/pull/1070#issuecomment-2287990626
Sorry for replying so late as we are testing a lot of scenarios. I found some issues. 1. If a question has been deleted then it should not appear in this recommended list.   2. If a question has been unlisted then it should not appear in this recommended list.  3. When the user doesn't follow the question, means `followedQuestionIDs` is empty, it may need to make special judgement. In PostgreSQL scenario, it will report an error. ``` [SQL] SELECT DISTINCT question.* FROM "question" INNER JOIN "tag_rel" ON question.id = tag_rel.object_id INNER JOIN "tag" ON tag.id = tag_rel.tag_id WHERE (((question.user_id != $1 and question.status = $2) AND (question.id NOT IN (SELECT question_id FROM answer WHERE user_id = $3)) AND (tag_rel.status = $4) AND 0=1) OR 0=1) ORDER BY CASE WHEN question.id IN ('') THEN 0 ELSE 1 END, question.pin DESC, question.created_at DESC LIMIT 20 [10040000000000237 1 10040000000000237 1] - 1.084875ms 2024-08-14 14:36:19.305 ERROR handler/handler.go:53 code: 500, reason: base.database_error, message: , error: pq: invalid input syntax for type bigint: "" incubator-answer/internal/repo/question/question_repo.go:426 github.com/apache/incubator-answer/internal/repo/question.(*questionRepo).GetRecommendQuestionPageByTags ``` Of course, when `followedQuestionIDs` is empty, I think `orderBySQL` could be optimised a bit too. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
