Skip to content
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

SetMemoRelations(...) can insert duplicated/wrong relation. #2749

Closed
harveyghq opened this issue Jan 12, 2024 · 0 comments · Fixed by #2750
Closed

SetMemoRelations(...) can insert duplicated/wrong relation. #2749

harveyghq opened this issue Jan 12, 2024 · 0 comments · Fixed by #2750
Labels
bug Something isn't working

Comments

@harveyghq
Copy link
Contributor

Describe the bug

When modifiy a related memo/comment, current SetMemoRelations v2 api inserts the existed relation again, violating the constraints on memo_relation table. If the requested memo id equals the related id in state.relationList, a reflexive relation can be inserted, which obviously isn't correct.

Steps to reproduce

  1. Write a comment C under a memo A (in memo detail page).
    2.1 Modify the comment C, which fails due to a duplicated insertion.
    2.2 Modify the memo A, refresh the page, and the relations go to a mess due to a reflexive insertion.

The version of Memos you're using

0.18.2

Screenshots or additional context

图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant