Anyone else have trouble switching accounts occasionally? - eviltoast

This is a weird one, because I can’t even figure out how to reproduce it reliably, but when using the account switcher on the profile page, occasionally, after switching to another account, it will continue displaying the previous accounts’ profile.

This only appears to happen with certain accounts, and only on my phone for some reason. I’ve tried adding the same accounts on the web app so I could use the React DevTools to try and see what’s going on, and I can’t get it to replicate there. Sometimes the new profile will take a second to load, but it always shows up. Not so on my phone.

Has anyone else noticed this or is it just me having this issue?

EDIT: this only appears to be affecting the feed at the bottom, the comment/post counts at the top of the page update immediately.

  • CmdrKeen@lemmy.todayOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    11 months ago

    UPDATE: I played around with this some more and DID get it to replicate in the browser after all, confirming that it is, indeed, random.

    When this situation occurs, it appears that the itemsRef prop on the Feed component still holds the old feed items.

    I also noticed that unlike the other pages that contain a Feed component, the ProfilePage doesn’t have a FeedContextProvider (which keeps a copy of that itemRef), so I tried wrapping it in one, hoping it might resolve the problem. Unfortunately, it did not seem to help.