-
-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Describe the bug
If a page is in a different state to the server (for example, if multiple tabs are open and one changes the state) it is possible to follow a thread multiple times, each time adding a separate row to the thread_followers table. Unfollowing then requires pressing "unfollow" that many times, since each time only removes 1 of the rows.
To Reproduce
Steps to reproduce the behavior:
- Open a post with a thread under it that the user is not following.
- Open it again in another tab.
- In the first tab, press "follow".
- In the second tab, press "follow".
- There are now 2 rows in the
thread_followerstable for that thread and that user, and "unfollow" will need to be pressed twice before it will change to show "follow" again.
Expected behavior
There should only ever be zero or one rows in the database for a given combination of user and thread. Compare with the behaviour for following new threads on a post. See app/controllers/comments_controller lines 332-350.