# Like button state is reset when another user likes the same post when our browser tab is still open

**URL:** https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239
**Category:** Bug
**Created:** [May 16, 2022, 6:10pm UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239 "2022-05-16T18:10:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 16, 2022, 6:10pm UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/1 "2022-05-16T18:10:21Z")

</div>

Hi,

I’ve not identified yet how this issue occurs exactly, but I came across it multiple times.

* * *

edit: found how to reproduce it, see the following reply:

> [@Like button state is reset when another user likes the same post when our browser tab is still open](https://meta.discourse.org/t/error-message-when-trying-to-like-an-already-liked-post-in-unknown-circumstances/227239/3):
>
> I found how to reproduce the issue. Like a post. Another user likes the same post. In your own tab, the like button is instantly re-activated, making the bug occurs:

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 16, 2022, 6:13pm UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/2 "2022-05-16T18:13:51Z")

</div>

This is the bug that was supposedly fixed last week:

[https://github.com/discourse/discourse/pull/16688](https://github.com/discourse/discourse/pull/16688)

The above PR fixes the obvious case of having the same topic in two different tabs / browsers / devices.

You can still trigger it if the second tab is so old that the MessageBus backlog was flushed and the app can’t recover the full history from it. No other way around.

If you find a way to repro this in another way in an up to date instance please fill a bug report about it with repro steps.

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [May 16, 2022, 6:31pm UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/3 "2022-05-16T18:31:26Z")

</div>

I found how to reproduce the issue.

1. Like a post.
2. Another user likes the same post.
3. In your own tab, the like button is instantly re-activated, making the bug occurs:

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 16, 2022, 8:56pm UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/4 "2022-05-16T20:56:11Z")

</div>

Thanks for the repro steps!

This should fix it:

[https://github.com/discourse/discourse/pull/16847](https://github.com/discourse/discourse/pull/16847)

---

<div class="post-metadata">

### Author: ![seanblue](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@seanblue](https://meta.discourse.org/u/seanblue)
#### Post date: [May 19, 2022, 2:36am UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/5 "2022-05-19T02:36:24Z")

</div>

Would you mind deploying latest to [community.wanikani.com](http://community.wanikani.com)? I’ve run into this issue several times in the last couple hours and it would be great to get it fixed. (We’re on a six day old commit for some reason.) Thanks!

Side question: How often are hosted sites usually updated to latest? I’m asking because I found it surprising that the fix wasn’t already automatically deployed.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [May 21, 2022, 11:00am UTC](https://meta.discourse.org/t/like-button-state-is-reset-when-another-user-likes-the-same-post-when-our-browser-tab-is-still-open/227239/6 "2022-05-21T11:00:13Z")

</div>

This topic was automatically closed after 4 days. New replies are no longer allowed.
