Visual BUG fix after adding new friend+DM#1541
Visual BUG fix after adding new friend+DM#1541LW-Davide wants to merge 14 commits intospacebarchat:masterfrom
Conversation
Visual BUG, after adding a new friend and (without refreshing the page) immediately creating a DM, the displayed name is your own name instead of the other person's name
|
(changing the |
| data: channel_dto, | ||
| data: channel_dto.excludedRecipients([creator_user_id]), | ||
| user_id: creator_user_id, | ||
| }); | ||
| } | ||
|
|
||
| if (recipients.length === 1) return channel_dto; | ||
| else return channel_dto.excludedRecipients([creator_user_id]); | ||
| if (recipients.length === 1) return channel_dto.excludedRecipients([creator_user_id]); |
There was a problem hiding this comment.
I'll have to test, but iirc this causes discord clients to crash (they need at least one recipient)
There was a problem hiding this comment.
(specifically causes a crash in case there's a DM where the other user's account has been deleted)
There was a problem hiding this comment.
if the account is deleted, the relation will return exactly one recipient, which is exactly what this code was trying to work around iirc (as all user data is deleted together with the author)
There was a problem hiding this comment.
Yeah, but it's causing a bug for non-deleted users.
Also found another issue, when trying to delete an account:
update or delete on table "users" violates foreign key constraint "FK_8ff3d1961a48b693810c9f99853" on table "user_settings_protos" Key (id)=(1473723585167176120) is still referenced from table "user_settings_protos".
There was a problem hiding this comment.
that's the easy solution, i think @ChrisChrome still has that in uncommitted changes?
There was a problem hiding this comment.
Added another commit, which solves the user deletion error
There was a problem hiding this comment.
Added a few commits to handle deleted users. If you can, please check them.
This aims to fix the account deletion error.
This needs to avoid empty or self recipients in case of deleted users
This needs to avoid empty or self recipients in case of deleted users, same logic as for src/util/dtos/DmChannelDTO.ts
Integrating commit c671db2 from the original project, which fixes the issue: "Fix user self delete not removing settings protos"
…clients to reconnect It tries to use Session.delete on this.session_id, but it's just a TEMP session name, so it doesn't match the one in the DB, which is this.session.session_id. Sometimes, when your internet is unstable, it may trigger, so we give a 5-second delay to avoid false positives.
Merging with spacebarchat/spacebarchat
Merging with spacebarchat/spacebarchat
More time in case of page reload before setting the user to offline
Replicating Discord's actions when adding a friend
Merging with spacebarchat/spacebarchat
Merging with spacebarchat/spacebarchat
Merge pull request





Visual BUG, after adding a new friend and (without refreshing the page) immediately creating a DM, the displayed name is your own name instead of the other person's name