fix: Hide synced chat if we only know its visibility#8343
Conversation
|
Tested with deltachat-desktop. Maybe we should default to setting |
|
Difference (unrelated to the bug itself) from UX perspective: Normally chat won't display on other devices until you send a first message or pin it (then it will display as a contact request, which IMO is confusing anyway, as we initiated the chat, not the other way around). After this change the chat will be displayed on other devices only after first message is sent. |
Do any tests fail when setting the default to Going through the SyncActions: Block,
Unblock,
Accept, // These three anyways set the blocked state of the chat, so that it doesn't matter what it was before
SetVisibility(ChatVisibility),
SetMuted(MuteDuration), // This one probably had the same bug as SetVisibility - muting a chat with an unfinished securejoin process probably created a weird chat on the second device
CreateOutBroadcast {
chat_name: String,
secret: String,
},
CreateGroupEncrypted(String), // These two are anyways handled by a different part of the match statement
Rename(String), // The function returns before `get_for_contact()` is called
SetContacts(Vec<String>),
SetPgpContacts(Vec<(String, String)>),
SetDescription(String), // These three are about groups and channels, not about 1:1 chats
Delete, // The chat will be deleted, no need to worry about itNot sure if all of my comments are understandable, but the result is that I think it's fine to change to |
|
Also, could you add a test? You can look at |
|
Reading the comment few lines higher: This is a bit odd though and it feels like we should be safe setting it to just |
The comment is indeed wrong, but let chat_id = ChatIdBlocked::get_for_contact(self, contact_id, Blocked::Yes)
.await?
.id;
ensure!(false);
chat_idcreates a hidden chat on the other device. Maybe just remove the comment and leave |
501651d to
b35008b
Compare
Hocuri
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing! Just some minor, and not too important, comments.
Prevents showing "empty" chat on other devices, when pinning a chat that did not complete securejoin yet. Fixes: #7713 Signed-off-by: Jagoda Ślązak <jslazak@jslazak.com>
b35008b to
b3c8e31
Compare
Prevents showing "empty" chat on other devices,
when pinning a chat that did not complete securejoin yet.
Fixes: #7713