DEV: no need to track status of a deleted user (#22836)

It is hard to catch and debug potential bugs related to live updates of user status 
(though, we haven't seen many such bugs so far). We have a `console.warn` 
statement that should help us to catch one class of such bugs.

Recently, we noticed that this warning gets printed when a user had a chat with 
a user that was then deleted.

This is not a bug, since there is nothing to track for a deleted user, but we don't 
want this noise on the console. This PR makes sure we don't print a warning in 
such cases.
This commit is contained in:
Andrei Prigorshnev 2023-09-04 17:00:09 +04:00 committed by GitHub
parent b59f1ad4ee
commit 3ee77c29a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -210,7 +210,10 @@ export default {
this.chatService = chatService;
if (this.oneOnOneMessage) {
this.channel.chatable.users[0].trackStatus();
const user = this.channel.chatable.users[0];
if (user.username !== I18n.t("chat.deleted_chat_username")) {
user.trackStatus();
}
}
}

View File

@ -25,6 +25,7 @@ en:
chat_users_count: "Chat Users"
chat:
deleted_chat_username: deleted
dates:
time_tiny: "h:mm"
all_loaded: "Showing all messages"