Skip to content
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

Federated typing indicators with same userId #12802

Open
SystemKeeper opened this issue Jul 24, 2024 · 13 comments
Open

Federated typing indicators with same userId #12802

SystemKeeper opened this issue Jul 24, 2024 · 13 comments

Comments

@SystemKeeper
Copy link
Contributor

Since it's not directly related to federated calls, I thought creating a new issue makes the most sense.

While testing #12604 I was unable to get typing indicators to work at first. For my testing I used the same userId on both servers, so I basically had 2 admins in my conversation:
image

Since we suppress typing indicators for ourselves, the federated indicator did not show up, but the signaling messages from that user were received fine.

Purely from the signaling message, I don't see a way to distinguish if it's "my" userId or a federated one:

{
  "type": "message",
  "message": {
    "sender": {
      "type": "session",
      "sessionid": "Tco...",
      "userid": "admin"
    },
    "data": {
      "type": "startedTyping",
      "to": "2fJ7u..."
    }
  }
}
@fancycode
Copy link
Member

You should rely on the sessionid in the sender to find out who sent a message. If it's your own (as received in the hello response), you sent the message, otherwise it's somebody else. You receive the other session ids in the join events.

@SystemKeeper
Copy link
Contributor Author

Yes, but if I have a session on web and one on iOS, currently when I type on web, I don’t show myself as typing in iOS. But this is not possible with the session id ?

@fancycode
Copy link
Member

@fancycode
Copy link
Member

Yes, but if I have a session on web and one on iOS, currently when I type on web, I don’t show myself as typing in iOS. But this is not possible with the session id ?

Oh, I see, that's right.

So what I could do is add a flag in the join event for the federated sessions, so you can differentiate from there, e.g. save the entries from the join events, use the sessionid from the typing indicator to lookup the entry and check the (tbd) federated flag. Would that solve your issue?

@SystemKeeper
Copy link
Contributor Author

Yes, having a federated would solve it. Then we could check userId == myUserId && !federated. But I am wondering if it would be easier to just add the federated flag to the typing message itself? Either on the signaling server or by the client, as the client also knows that it’s a federated room.

@fancycode
Copy link
Member

We might need the information for other parts in the future, too. Also I would rather have it only once in the join event than including it in every typing message.

@SystemKeeper
Copy link
Contributor Author

Just to be sure (I don't know right now on the top of my head), when I join a room where participants are already there, do I still receive a join for those that are already part of the conversation? And there's no chance that a typing message would be received before I receive a join message, right? I guess then it would work as well and we can just map the session.

@fancycode
Copy link
Member

You will receive join events for all sessions already in the room. As they are sent asynchronously (especially in clustered setups), there is a small chance that a typing message could be sent while these join events are being sent.

How do you get the display name to show with the typing status? Don't you use the session id to lookup the entry from the join events already?

@fancycode
Copy link
Member

Flag added in strukturag/nextcloud-spreed-signaling@fc0591b

@SystemKeeper
Copy link
Contributor Author

How do you get the display name to show with the typing status? Don't you use the session id to lookup the entry from the join events already?

That is a very good point indeed 😂 Yes, then this would be absolutely fine. Thanks!

@SystemKeeper

This comment was marked as off-topic.

@nickvergessen
Copy link
Member

Is there still something to do here?
If so for whom? Backend or Frontend/clients?

@SystemKeeper
Copy link
Contributor Author

The flag was added and the handling was implemented on iOS. In theory frontend needs to also handle this, but might not be worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📄 To do (~10 entries)
Development

No branches or pull requests

6 participants