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

[Bug] Dissapearing messages / duplicated messages in chat #10027

Closed
Antreesy opened this issue Jul 21, 2023 · 0 comments · Fixed by #10058
Closed

[Bug] Dissapearing messages / duplicated messages in chat #10027

Antreesy opened this issue Jul 21, 2023 · 0 comments · Fixed by #10058
Assignees
Labels

Comments

@Antreesy
Copy link
Contributor

Antreesy commented Jul 21, 2023

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Seems like this mutation causes incorrect object reference to be patched with wrong data:

addMessage(state, message) {
if (!state.messages[message.token]) {
Vue.set(state.messages, message.token, {})
}
if (state.messages[message.token][message.id]) {
Vue.set(state.messages[message.token], message.id,
Object.assign(state.messages[message.token][message.id], message)
)
} else {
Vue.set(state.messages[message.token], message.id, message)
}
},

Resulting in replacing the message in store and in DOM tree (message id=2017713 dissapears, and message id=2017786 is duplicated):

2017713: {
    "id": 2017786,
    "token": "TOKEN",
    "actorType": "users",
    "actorId": "actor",
    "actorDisplayName": "...",
    "timestamp": 1689252346,
    "message": "> temporary messages has relatively longer id with prefix 'temp-'...",
    ...
},
...
2017786: {
    "id": 2017786,
    "token": "TOKEN",
    "actorType": "users",
    "actorId": "actor",
    "actorDisplayName": "...",
    "timestamp": 1689252346,
    "message": "> temporary messages has relatively longer id with prefix 'temp-'...",
    ...
}

image

Steps to reproduce

Algorithm for reproducing is not defined, as it happens sometime after fetching a new messages from server.
Upd: happens quite often for system messages:
image

Expected behaviour

Messages should not be duplicated

Actual behaviour

See screenshot above

Talk app

Talk app version: at least 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants