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

Notify everyone up on comment thread #212

Open
Betree opened this issue Jul 9, 2021 · 1 comment
Open

Notify everyone up on comment thread #212

Betree opened this issue Jul 9, 2021 · 1 comment
Assignees
Labels
backend Everything for https://github.com/CaptainFact/captain-fact-api complexity > medium Consequent tasks, usually done in one to three days of work improvement Improvements to existing features (enhancements)

Comments

@Betree
Copy link
Member

Betree commented Jul 9, 2021

Today, when replying to the reply of a comment, the comment's author doesn't get notified (only the direct replies do). The notification should go up the tree and notify everyone above.

@Betree Betree added improvement Improvements to existing features (enhancements) backend Everything for https://github.com/CaptainFact/captain-fact-api complexity > simple Simple tasks (usually a few hours) labels Jul 9, 2021
@Betree Betree added complexity > medium Consequent tasks, usually done in one to three days of work and removed complexity > simple Simple tasks (usually a few hours) labels Sep 1, 2021
@Betree
Copy link
Member Author

Betree commented Sep 1, 2021

Specs proposal

  • Add a thread column on Comments (string)
  • When creating a comment, the value for thread should be:
    • nil if it's a root comment
    • #{reply_to.id} when it's a reply to a root comment
    • #{reply_to.thread}-#{reply_to.id} for other replies
      Example: 42-67-88
  • In the migration, generate thread for all existing comments
  • When querying for the accounts to notify, look at the first id from thread (the root comment) and notify everyone

Storing the thread like that has multiple benefits:

  • It allows us to review who should be notified in the future
  • It gives an indication of the current depth of the comment (useful for Limit comment max depth #38)

It has one major downside: it's a "soft" relation, meaning that if we delete/edit one of the root comments children won't be deleted.

@Betree Betree self-assigned this Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Everything for https://github.com/CaptainFact/captain-fact-api complexity > medium Consequent tasks, usually done in one to three days of work improvement Improvements to existing features (enhancements)
Projects
None yet
Development

No branches or pull requests

1 participant