-
Notifications
You must be signed in to change notification settings - Fork 29
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
Unread notifications vanish on the app-root pages #6337
Comments
@eatyourgreens is this true for all app-root pages? Or just the homepage at |
It happens to me with unread messages. After counting 45 seconds, the unread messages do get loaded on the home page. @eatyourgreens have you tried waiting for so long? :) |
@goplayoutside3 here's a longer video where I click around a few different pages, including Panoptes Front End and both Next.js apps. Notifications are missing across all the pages from the new app ( @yshish I haven't tried waiting to see if the notifications load eventually. Screen.Recording.2024-09-24.at.16.36.00.mov |
(Ah, just visited the home page again to see whether it happens for both notifications and messages to me and waited for longer than 2 minutes before the unread loaded. And yes, it happens for both.) |
I just waited for 2 minutes on the home page but nothing changed, so maybe this is a different bug from #6336. EDIT: and, of course, as soon as I posted that, my notification count did load in the tab that's showing the Zooniverse home page. So yes, notifications do load if I wait for 2 or 3 minutes. |
I can reproduce that by leaving the home page, going to Talk, and coming back to the home page. I can also force the home page to reload notifications, by going to another tab then back to the Zooniverse tab, which forces the API request to refresh. In that case, unread notifications generally show up. |
OK, after a bit of playing around on the Zooniverse site, here's my workaround to make notifications appear instantly:
Technical details: I think I implemented the notifications count with SWR, which refreshes API data when either tab visibility or tab focus changes, so switching to a new tab and back can force it to perform a data fetch. So many sites use SWR, or React Query, now that I use this trick on many web pages to force data to refresh. |
This bug vanishes if you go into local storage and delete the |
D'oh! Notifications and messages don't wait for I somehow managed to forget my own documentation when I wrote those hooks. |
Package
Describe the bug
Unread notifications vanish when I go from Talk to the new home page, then reappear when I go back to Talk.
To Reproduce
Here's a video where I've got 2 unread notifications in the top bar, but they don't appear on the home page.
Screen.Recording.2024-09-24.at.16.05.52.mov
Expected behavior
Unread notifications should be consistent across the various different React apps that make up the Zooniverse site.
The text was updated successfully, but these errors were encountered: