-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
If the FlatMode
is disabled, the reply will be hidden in the GET /comments
#891
Comments
Ok, I was trying to generate the root_id by enabling the |
Ok, I think the force generated Root ID solved my problems. |
这个可能是 root_id 没有正确生成导致的问题(相关:#848 #846 #833),可以检查 comments 表中 root_id 列是否全为 0,如果 root_id 不正确可以尝试在 artalk 启动前增加环境变量 ATK_DB_MIGRATOR_FUNC_MIGRATE_ROOT_ID=1 重新生成 root_id。 root_id 是用于缓存评论树叶子节点往上的最顶层根节点 ID,缓存递归查询结果提高性能 This issue may be caused by the incorrect generation of root_id (related: #848 #846 #833). You can check if the root_id column in the comments table is all set to 0. If root_id is incorrect, you can try adding the environment variable ATK_DB_MIGRATOR_FUNC_MIGRATE_ROOT_ID=1 before starting artalk to regenerate root_id. root_id is used to cache the ID of the top-level root node upwards from the leaf nodes of the comment tree, caching recursive query results to improve performance. |
Alright, I got it. You've solved it already! :) |
@qwqcode Yep, you are right. After reading your code and debugging locally. I found that it was caused by the missing root id. But I didn't meet the comments loading issue until you have migrated the query logic to Given that I can't find any documentation that describes the |
I'm sorry, you're right. I should have added some documentation to address this issue, but I've been too busy lately. I missed some pre-release testing in v2.8.5 and overlooked the fact that some older databases don't support SQL recursive CTE and not providing a fallback solution. This resulted in root_id not being generated correctly for some users upgrading to v2.8.5. However, this issue should have been fixed in v2.8.6. My intention was to make these changes to the data structure and upgrades seamless and automatic. |
Haha, I see. I'm not mean to complain. BTW, this regression didn't get resolved in 2.8.6 release if the Thanks your great works. |
I think the commit introduced this bug.
After commenting the line, everything works as expected.
As I debugging further into the code. I found that when I was using the Postgres or MySQL with Artalk, the RootID will be NULL by default. This will make
findNestedChildren
method buggy.The text was updated successfully, but these errors were encountered: