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

duplicated messages in chat #4605

Closed
mahibi opened this issue Jan 15, 2025 · 13 comments · Fixed by #4641
Closed

duplicated messages in chat #4605

mahibi opened this issue Jan 15, 2025 · 13 comments · Fixed by #4641
Assignees
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) feature: chat 🗨️
Milestone

Comments

@mahibi
Copy link
Collaborator

mahibi commented Jan 15, 2025

After sending a message, it is shown multiple times.
The duplicates are shown while being in the chat but were removed after exiting and entering a chat again.
Happens randomly

reported by @miaulalala for v20.1.1 RC1

I used the Talk Android for the company call yesterday. Sometimes the chat appeared to hang, then messages arrived as duplicates. I can't say how many duplicates, but it filled the screen. I didn't try to scroll. At some point the duplicates vanished again, I can't say if it was when the next message arrived or some other point in time.

reported by @ChristophWurst for v20.1.0.

@mahibi mahibi added the 1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) label Jan 15, 2025
@mahibi mahibi added this to the 20.1.1 milestone Jan 15, 2025
@mahibi mahibi self-assigned this Jan 15, 2025
@mahibi mahibi changed the title duplicated messages in chat (after sending) duplicated messages in chat Jan 15, 2025
@mahibi
Copy link
Collaborator Author

mahibi commented Jan 15, 2025

can't reproduce yet. Also not when posting a lot of messages by script.

@migulen
Copy link

migulen commented Jan 16, 2025

@mahibi I can confirm that this happens "randomly". At private conversations (2 participants), I think it happens more times just when the other participant just enters to the chat.

It's annoying.

It's not a problem about "reception/storage disfunction" but more about "view/printing controller". Messages in my case are not duplicate, them are always TRIplicated on a private conversation (2 participants), if there are more participants, the messages could be more, but I think always by a multiple of 3 * the number of participants that have just entered to check the room/conversation.

Hope it helps.

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 17, 2025

thanks @migulen , i'm having a closer look. For which version(s) does this happen for you?

@migulen
Copy link

migulen commented Jan 17, 2025

@mahibi

Nowadays:

Talk-Android v20.1.1-RC1
Nextcloud Server v28.0.10
Talk Server v18.0.11

But has been happening since other older versions, too (don' remember since when exactly).

I'm going to ask to some users if it happens on Talk-IOS,too.

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 17, 2025

I'm going to ask to some users if it happens on Talk-IOS,too.

iOS is not affected

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 17, 2025

i forgot that #2171 was opened again. I can reproduce.
So one thing to trigger this is at least a configuration state change like screen rotation.

Do you remember if you did configurations changes like
- App display size
- Screen orientation
- Font size and weight
- Locale
- Dark mode versus light mode
- Keyboard availability
when it happend?

So most likely is a change of Screen orientation. Is automatic screen rotation enabled on your devices @migulen @miaulalala @ChristophWurst ?

@ChristophWurst
Copy link
Member

🎯 yes, in fact I did rotate my screen during the call a few times. Sorry, I should have mentioned that.

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 17, 2025

🎯 yes, in fact I did rotate my screen during the call a few times. Sorry, I should have mentioned that.

well, users of course can't think of that screen rotation is related to an issue like this.
Thanks to confirm.

@migulen
Copy link

migulen commented Jan 17, 2025

@mahibi I have configured rotation screen on my device, too.

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 17, 2025

just a note to myself for monday:

  • Long term solution: all in all, a lot of data has to be migrated to ViewModel while at the same time some observers are not necessary in the Activity.

  • As a quickfix, it MAY be enough to just avoid duplicated calls of
    chatViewModel.getRoom(roomToken)
    in onResume() by checking if the viewModel already has data for getConversationFlow, however this may have to be converted to a hot flow then..

@miaulalala
Copy link

i forgot that #2171 was opened again. I can reproduce. So one thing to trigger this is at least a configuration state change like screen rotation.

Do you remember if you did configurations changes like - App display size - Screen orientation - Font size and weight - Locale - Dark mode versus light mode - Keyboard availability when it happend?

So most likely is a change of Screen orientation. Is automatic screen rotation enabled on your devices @migulen @miaulalala @ChristophWurst ?

no

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 21, 2025

no

might be this is an other issue then. If it happens again, please think about if any of the other config changes were made when chat was opened.

@mahibi
Copy link
Collaborator Author

mahibi commented Jan 21, 2025

Reason for the multiple chat messages after screen rotation is:

LongPolling is initialized again after configuration state change. So there are multiple long polling requests running..
Will have a closer look tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of (should be only set by nextcloud employees) feature: chat 🗨️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants