-
Notifications
You must be signed in to change notification settings - Fork 105
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
Group chat without an avatar uses the avatar of first person to join #2003
Comments
Currently the avatar is computed by the proxy. It is ignoring the matrix-org/sliding-sync#208 (comment)
Thinking about this, now that we have access to the room heroes, we could probably start using those locally with the exact rules we would like and stop computing the avatar on the server. |
Room heros aren't supported yet as far as I know, matrix-org/matrix-rust-sdk#2702. It's under implementation. |
Right now, the avatar is computed on the server. The implementation didn't take care of this use case. Here are the possible ways to move forward: Have the client compute heroesThis would require implementing the concept of heroes in the client's sliding sync. Of course, it would be the most invasive change, since we never had that, and even commented in the code that we'd probably never implement it, since the server does compute the avatars for us. We'd have perfect control over what we display, at the cost of reimplementing it all by ourselves, and requiring that every client that doesn't use the Rust SDK also re-implement it by themselves. Tweak the server responseI think the simplest change and best way to move forward would be to tweak the server-side rules:
Does that sound reasonable and easily doable @DMRobertson @kegsay? (If yes, sorry to add things to your todo-list.) Addendum: can the client try to remove the avatar from the server, based on the number of room members?Unfortunately no: the client can't distinguish "a room has an avatar that has been explicitly set" from "a room has no avatar and the server returned the avatar of the first person". So if we added a rule to remove avatars if a group conversation with >2 people had one, we could end up in a situation where we'd incorrectly remove an avatar that was explicitly set. |
You could distinguish this by requesting the
This should be exactly the logic the sliding sync proxy is using today: https://github.com/matrix-org/sliding-sync/blob/62d3798955eaf183fc36111b543fe329e570c88e/internal/roomname.go#L264-L275 |
Ah thanks, that's good to know. Then the situation exposed in this issue should not happen. What I suppose is the error was that someone created a group, invited >2 people, first person joined and their avatar was used as the room avatar, and then somebody joined but the room avatar still was that of the first person. I double-checked and the client should update the avatar correctly in this situation (I'll write a test for that). I wonder if the server is not sending us an updated avatar because |
It's been a while since I wrote this, but from a quick view it looks like the conditions match up.
That's possible! We do have an E2E testing covering a "group DM" with three users (whatever that means), but it's created in one go by atomically inviting the other two at creation time: https://github.com/matrix-org/sliding-sync/blob/37aa1469a53afecf4226bff7ea11fd7859a79af0/tests-e2e/lists_test.go#L1373-L1377 It should be easy enough to recreate any reproduction steps in this test, if anyone can confirm how to trigger this. |
Here you go! I wrote an integration test to help reproduce and find where the issue is, and I have a confirmation that it's the proxy server returning the avatar for one of the invitees. Instructions are included in that PR to reproduce it at home. |
Sorry, turns out it might be the Rust SDK's fault after all: we only memorize a new room avatar when we see one, and never delete it, which is technically a bug if it's been unset. Unfortunately, there's a comment above the code doing that, suggesting that the proxy server may not return data that hasn't changed. Ruma deserializes the |
Sorry again for jumping to conclusions and blaming the proxy server on this; thanks to @DMRobertson and @stefanceriu for the group investigation. In fact, it's both the proxy and the client misbehaving here (things can't be black or white, can they?). When starting such a group conversation, first the proxy starts with setting the Then, the bug in the client (explained in the previous comment) dismissed the second update, and kept the group avatar set to the first person's avatar. This should be fixed in this PR. |
I want to claim fixed by matrix-org/matrix-rust-sdk#2867 as Stefan couldn't reproduce the issue with my patch, so closing. Please reopen if there's still a bug here. |
Untitled.mp4The bug is still there. See video. |
Alrighty, this time round it does look like it's a backend issue where the room gets an avatar that's never unset (like the previous behavior) If I am to venture a guess I would say it's not exactly what Doug said at the beginning of this thread: the room only has 2 members, it's considered a dm and this logic kicks in https://github.com/matrix-org/sliding-sync/pull/208/files#diff-591e344e78956e112ee213f5ab8e2dd85ee4d6d327ddb85a06ec23910fac4a4fR257 cc @bnjbvr and epecially @DMRobertson -- Room creation --
-- SS Responses --
-- Subsequent SS connections --
|
Right---I could have sworn that's the behaviour we wanted when I was implementing this. I can change the logic to make the avatar field only use the other member's avatar if the room is a DM according to account data. But due to recent circumstances, I'll have to get it done before Friday 8th Dec. |
Should be fixed by matrix-org/sliding-sync#394. |
Oh nice 👏 |
The last release of the sliding sync proxy (https://github.com/matrix-org/sliding-sync/releases/tag/v0.99.15) contains the fix and it is now live for matrix.org users. |
Steps to reproduce
Outcome
What did you expect?
Group chat without avatar does not have an avatar set
What happened instead?
The avatar of the first user to join is used for the group chat
Internal reference: iOSX-6
Your phone model
No response
Operating system version
No response
Application version
No response
Homeserver
No response
Will you send logs?
No
The text was updated successfully, but these errors were encountered: