Topics incorrectly stuck in unread state on Android in Chrome 77

AI-generated summary

Users reported that topics were incorrectly stuck in the unread state on Android Chrome 77 due to changes in the Page Visibility API. sam identified the root cause and implemented a fix (commit), which was deployed on Meta and included in Discourse version 0420e8145e (2.4.0.beta4). Wingtip confirmed the fix worked after updating, and Heather_Dudley reported the issue resolved on their installation as well, noting any remaining unread issues were due to network traffic, not the bug. codinghorror also tagged Wingtip to ensure awareness. A full reload was required to apply the fix. The issue primarily affected users who switched away from the app for 5–10 minutes and returned to find topics no longer marked as read.

Per: Unread tab does not update after reading

There were quite a few people mentioning issues with topics not being marked read on Android.

We have done some root cause analysis and found that the page visibility api changed the way it operates in Android Chrome 77.

It was discussed in brief here:

https://github.com/pgilad/react-page-visibility/issues/9

There is a fancy graph that explains the new lifecycle here:

The symptoms of the issue is.

  • You use your android

  • You flip to do something else for 5-10 minutes

  • You flip back to Discourse and nothing is marked read anymore

I made a fix for this here:

https://github.com/discourse/discourse/commit/499472b6a0e9bd0cef4539287e9845476938cf01

In “theory” it should resolve the issue.

cc @mcwumbly / @Heather_Dudley / @Yuun

This fix will be deployed on meta shortly, you will have to do a full reload to get it applied.

17 Likes

Also applies to you @Wingtip

1 Like

Fantastic, is the fix available yet? On 2.4.0.beta4 [0420e8145e] now.

Yes, the fix is included on 0420e8145e.

4 Likes

Looks to have worked! Thanks again.

4 Likes

Seems to be working for us now, too. I haven’t had this issue on meta anymore, and what unread issues we’re having on my installation are related to network traffic, not the bug.

Thank you guys!

3 Likes