lemmy-ui icon indicating copy to clipboard operation
lemmy-ui copied to clipboard

[Bug]: Lemmy.ml - profile menu had another user's username

Open drspod opened this issue 2 years ago • 14 comments

Requirements

  • [X] Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a single bug? Do not put multiple bugs in one issue.
  • [ ] Is this a server side (not related to the UI) issue? Use the Lemmy back end repo.

Summary

I just loaded the front page of lemmy.ml and in the top right where my username (drspod) usually appears, there was another user's username (glymfeather).

lemmy_bug

The page is not using my selected theme (dark mode) and when I click the username or notification button, nothing happens, which is what I usually experience if the page has not loaded correctly.

Loading the page again in a new tab fixed the issue and showed me my front page with my theme and username in top right.

Steps to Reproduce

  1. Load the front page of https://lemmy.ml
  2. The displayed page had been generated for a different user.

Technical Details

Javascript console contains:

Loading failed for the <script> with source “https://lemmy.ml/static/js/client.js”. lemmy.ml:510:54
Error: Promised response from onMessage listener went out of scope 12 init.js:75:34

in addition to some CSS errors and blocked cookie warnings.

Version

0.17.4

Lemmy Instance URL

lemmy.ml

drspod avatar Jun 18 '23 18:06 drspod

It just happened again:

lemmy_bug2

The posts in the feed appear to be my own subscriptions. It seems unlikely that the user whose name appears in the top-right is subscribed to the exact same communities as me. So the issue seems to be with putting incorrect user details in the top-right of the page, even though the feed was generated correctly (minus correct theme styling).

When I clicked the notifications button it took me to my own notifications page (correctly themed), so I was not able to view the other user's notifications. I don't know how this would be affected if the user had some active notifications that might create the popup toast text on the main page though.

drspod avatar Jun 20 '23 17:06 drspod

Cannot reproduce in 0.18. If this continues to be a problem, please comment or reach out and we'll address it.

alectrocute avatar Jun 23 '23 00:06 alectrocute

Hi @alectrocute I can confirm this has been an issue since I started using Lemmy.

rcmaehl avatar Jun 24 '23 02:06 rcmaehl

I'll try to sign up for lemmy.ml since I tested on lemmy.world which is 0.17.4 still.

Animation

In this 2 minute clip of Ctrl+F5ing I was briefly:

  • CountZero0 (long period of Ctrl F5 working fine)
  • T-800
  • fireweed
  • Shuzen_chin
  • Cory

This actually seems to have gotten worse today as on mobile I loaded a users' entire profile in Jerboa.

rcmaehl avatar Jun 24 '23 02:06 rcmaehl

My lemmy.ml account just got approved. I can verify this is still occuring on 0.18.0. Let me grab video and I'll edit it onto this comment.

Edit:

Animation2

Shows:

  • chewy6982 (after a few attempts)

It seems to be significantly less common on lemmy.ml. I'm not sure if this is because of the version difference or resource load differences. It does

rcmaehl avatar Jun 24 '23 15:06 rcmaehl

Thanks for the follow up. Reopening.

alectrocute avatar Jun 24 '23 16:06 alectrocute

@alectrocute I can confirm #1641 did not resolve the issue (if it was released in 0.18.1)

Tested today on Lemmy.world

0 18 1

rcmaehl avatar Jul 09 '23 18:07 rcmaehl

#1882 Potential solution is proposed here.

TLDR: Using JS Singleton may be causing the issue in conjunction with SSR. Storing UserService in react context may resolve this issue.

pproe avatar Jul 09 '23 22:07 pproe

This happens to me frequently on lemmy.world -- I'd say more than 50% chance on any given page reload (more if this is the same bug that sometimes initially causes me to appear not to be logged in). I can reproduce it in the very latest version -- UI: 0.18.2 and BE: 0.18.2-1-g68276b2f9 as per the site footer.

What really made me notice this bug today is the way that it interacts with the user script LemmyTools, which provides a logged-in user with a sidebar containing a list of the communities to which the user is subscribed. The script fetches this information immediately after the initial page load, which means that whenever the bug hits I am left with a persistent list of some other random user's subscriptions (until I refresh the page). This seems like something that could have privacy implications -- although I understand that a lot of user information which is not exposed by the web UI can nevertheless be requested through the API used for federation, and thus isn't truly private. So perhaps nothing that is actually secret can be leaked in this way.

confluence avatar Jul 12 '23 22:07 confluence

@alectrocute I can confirm #1641 did not resolve the issue (if it was released in 0.18.1)

Tested today on Lemmy.world

GIF image

I have a similar small bug that generally doesn't interfere with daily usage but concerns me with regard to privacy, where often I'd often see it looking like I'm logged out temporarily. But strangely, also showing a different username - this is also temporary and has only happened twice so far.

Last time I was able to find the user on the instance by loading his profile by typing in his name on the url (u/username), though this time it didn't seem to appear. I assume somehow a fake or suspended account showed up.

Hope this helps.

ezgif-2-f872fb06bd

wallflowerpaper avatar Jul 26 '23 16:07 wallflowerpaper

This happens on feddit.de, too:

https://feddit.de/post/6731353

h3ndrik avatar Dec 15 '23 16:12 h3ndrik

This is still an issue, I'm on lemmy.ml. I can also click the other username and then interact with profile and settings. Did not click anything in the settings though, not sure if it would change mine or theirs.

karhima avatar Mar 22 '24 16:03 karhima

This is happening to me for months now. It's showing another username for a short instant, before returning to my username. The problem seems to happen only on lemmy.ml, I haven't seen it on lemmy.world.

eugenialoli avatar Mar 25 '24 20:03 eugenialoli

I believe this is fixed on main by this:

https://github.com/LemmyNet/lemmy-ui/blob/610789242bfd8ddf5749bd21ac81f206ae9bfca1/src/server/handlers/catch-all-handler.tsx#L145-L149

matc-pub avatar Mar 25 '24 22:03 matc-pub

I haven't seen this bug again for a little while now, so it looks to have been fixed. Using lemmy.ml which is currently running 0.19.4

drspod avatar Jun 10 '24 17:06 drspod