Skip to content

RTC: Same user with the post open in multiple tabs appears multiple times in the collaborators list #78700

Open

Description

@smithjw1

What problem does this address?

If a single WordPress user has the same post open in two (or more) tabs simultaneously, they appear as multiple separate entries in the collaborators list, each with its own avatar and color. This is misleading — other collaborators perceive more concurrent editors than there actually are, and the user themselves sees their own avatar duplicated.

#76145 and #75648 addressed the related ghost-session-after-refresh issue (closed via #75883, which added pagehide-based clean disconnects). Those fixes do not cover the deliberate multi-tab case, because both tabs are genuinely live Yjs awareness clients.

Root cause

The presence list is keyed by Yjs clientId, which is per-connection, not by WordPress user ID:

  • awareness-state.ts:284-290 — builds the state map keyed by clientId.
  • collaborators-presence/index.tsx:105 and list.tsx:78 — render with key={collaboratorState.clientId}.

There is no dedup on collaboratorInfo.id (the WordPress user ID) before rendering.

Proposed solution

When rendering the collaborators list (header avatars and popover list), group awareness states by WordPress user ID and render one entry per user. Pick a canonical session for display (e.g. most recently active).

This is a render-layer change only. The underlying awareness state stays per-clientId so cursor/selection rendering for each individual session continues exactly as it does today.

Activity

  1. pkevan commented on May 27, 2026

    @pkevan
    Contributor

    Feels like this is a preference based enhancement and as such, it should probably be a configurable option if it is to be added.

  2. Mamaduka commented on May 27, 2026

    @Mamaduka
    Member

    I thought that was intentional to show that the user might be editing the same content in different browsers, machines, etc.

  3. amitraj2203 commented on May 27, 2026

    @amitraj2203
    Contributor

    I thought that was intentional to show that the user might be editing the same content in different browsers, machines, etc.

    Hi @Mamaduka, if it's intentional then I observed a behaviour which I'm not sure if its correct.

    When the same WordPress user has a post open in multiple browser tabs, each tab creates its own Yjs connection with a unique client ID. The connection limit check counts these raw client IDs instead of unique WordPress users, so a single user with 3 tabs open alongside one other collaborator hits the limit of 3 and triggers "Too many editors connected" even though there are only 2 people editing.

    Steps to replicate:

    1. Log in as User A and open a post for editing
    2. In a separate browser/incognito window, log in as User B and open the same post, both users should see each other's avatars in the RTC toolbar
    3. User B opens a second tab on the same post, it still works fine
    4. User B opens a third tab on the same post. The third tab shows no RTC icons, and after ~20 seconds displays "Too many editors connected. Real-time collaboration has reached its connection limit"

    Ideally it shouldn't show this message because only 2 unique users are editing the same post

  4. smithjw1 commented on May 27, 2026

    @smithjw1
    ContributorAuthor

    Feels like this is a preference based enhancement and as such, it should probably be a configurable option if it is to be added.

    I agree that folks may want to view this in different ways, and it makes sense to either add a filter or a preference.

  5. Mamaduka commented on May 28, 2026

    @Mamaduka
    Member

    I think a better default should be preferred over a new preference or a filter.

    Open questions:

    1. Is this a behavior most users would want and use?
    2. Do other collaborative tools provide it?

    If the answer to both questions is no, we could just change the behavior. We can always add filters in the future, but once introduced, we'll have to maintainn backward compatibility forever.

    As they say in open source, no is temporary, yes is forever.

  6. smithjw1 commented on May 28, 2026

    @smithjw1
    ContributorAuthor

    Google docs doesn't have a list of active collaborators at all (that I could find), but it does show your presence once per tab.
    Image

    Figma shows my icon twice, but I don't appear twice in the collaborator list.
    Image

    I'd be interested in @dabowman's take here. My opinion is that the avatar dropdown should have one entry per user. But the expectation of presence indicators in the body is one cursor per tab. That way, you know where the user can focus, which informs your actions.

  7. maxschmeling commented on May 29, 2026

    @maxschmeling
    Contributor

    You definitely need some way to indicate there are multiple clients. You need to be able to:

    1. See why you might be hitting collaborator limits when there aren't other collaborators
    2. Click on the collaborator/client to be taken to where their cursor is (even if it's your own from another browser)

    We could remove them from the list or provide someway to see that one collaborator represents multiple clients. But I don't know that it should be configurable. If you have two different browsers connected and running independent sessions, I think that should show up.

  8. smithjw1 commented on Jun 4, 2026

    @smithjw1
    ContributorAuthor

    @dabowman could you weigh in? We should decide if we are going to do something, what we are going to do or close this.

  9. dabowman commented on Jun 4, 2026

    @dabowman
    Contributor

    Hey y'all. These are the two choices as I see them:

    1. Just show all the collaborators.

    If you've got three tabs open then you show up three times. It's accurately showing you the state of the document. It might be slightly cluttered, but if you don't like it, then just close your tabs! No big deal.

    1. We anticipate that the user will find their presence showing up multiple times annoying and try to clean it up.

    I think this makes two assumptions: that the user has a legitimate reason to have a bunch of tabs open at once and that seeing their active presence more than once will be so annoying that it becomes an issue.

    I'm not totally convinced that either of those assumptions are true for most folks. Trying to digest their presence and hide instances of it risks more than it gains imho.

    In any case, the sessions should go idle as they currently do, which reduces their visibility by dimming them in the list and removing their cursor and highlight. So if a user has a bunch of tabs open that they forgot about they just show up as idle in the list and the canvas stays clean, eventually they time out and are removed.

    I'd just leave it be. If lots of folks complain that it's an issue we could revisit but it don't see a super compelling reason to try and change the expected behavior of the presence indicators to anticipate a user having an issue with this. At least from a design perspective.

  10. giteshsarvaiya commented on Jul 4, 2026

    @giteshsarvaiya
    Contributor

    I think, it is a choice we are making in terms of trade-off, if we hide presence indicators, the editor who has kept it opened in multiple tabs (or multiple collaborators are using same email id), might not be able to track the activity. And if we keep the indicators, it might become distractive for some niche usecases for some niche users.

    After reading all the comments in this discussion, I feel we can choose the 1st one as of now, untill we have enough evidence/reports/complaints of the niche usecases popping up where it is become distractive.

    Good discussion, I was thinking of filing it as well and start a discussion around it, but found that it is already up here.

    Thanks for raising it @smithjw1 already

  11. giteshsarvaiya commented on Jul 6, 2026

    @giteshsarvaiya
    Contributor

    Agreeing with @maxschmeling that we need some way to indicate there are multiple clients from the same account, and with @dabowman's take on leaving sessions visible by default (option 1) rather than collapsing them. Collapsing risks losing real information, like two different cursor positions when someone's genuinely working from two devices.

    If that's the direction, there are two smaller refinements worth discussing that don't require touching the core behavior:

    1. Notification noise. Each tab currently fires its own independent "X has joined the post" / "X has left the post" toast. A user with 3 tabs open triggers 3 separate join notifications for what is, from everyone else's perspective, one person arriving. This doesn't require collapsing the presence entries themselves, just deduping the notification side by WordPress user ID plus session count, so it fires once per user with a "(x2)" type indicator instead of once per tab.

    2. Distinguishing same-account sessions. This is the piece @maxschmeling flagged: right now two sessions of the same account render identically (same name, same avatar, same color), so there's no way to tell it's one person in two tabs versus two people who happen to share a display name. A small badge or suffix would fix this without hiding anything, and it directly helps with the connection-limit case @smithjw1 raised, since it'd make it obvious at a glance that a limit is being hit by one person's tabs rather than distinct collaborators.

    Happy to put together a small PR for either of these if useful, since neither seems to require the bigger design call.

    P.S. This is what I was getting at in #79868, closing that one out now in favor of continuing here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions