Participating in an issue does not immediately update the subscribe button
Summary
This affects users with notifications enabled for issues that they are participating in. This affects issues that the user has not yet participated in and is not currently subscribed in. After a user participates in an issue for the first time, the Subscribe button does not update to say Unsubscribe until a page refresh.
This lack of correct visual feedback can cause a user to assume that they are not subscribed to the issue, even if the server has them currently marked as participating and implicitly subscribed.
Steps to reproduce
- Set notification level to
ParticipateunderProfile Settings->Notifications. - Find an issue that you are not participating in and have not subscribed to.
- Click the
👍 button on the issue. (I believe that the server has been notified that this button was clicked, so you are now marked as participating and implicitly subscribed.) - Observe that the button still says
Subscribe. - Since you want to receive notifications, click on the
Subscribebutton. (I believe the server has been notified that this button was clicked, so you are now marked as participating but explicitly unsubscribed.) - Observe that the button now says
Unsubscribe. - Refresh the page.
- Observe that the button now says
Subscribe.
Expected behavior
After clicking Subscribe to Unsubscribe.
Actual behavior
After clicking Subscribe.
Possible fixes
A simple fix is just to immediately update the button after participating (if their notification level is set to Participate).
A better fix, in my opinion, is to stop overloading the meaning of this button. Clicking this button has different effects depending on the current participation status of the user. This is a problem because these effects are not equivalent from the perspective of the user. I would propose adding some other visual element, such as a dropdown menu, to replace the subscribe button. This would inform the user if they are receiving notifications because they explicitly clicked Subscribe or just because they participated. This is discussed further https://gitlab.com/gitlab-org/gitlab-ce/issues/12697#note_17221179