-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
feat: Set BccSelf to true when receiving a sync message #6434
base: main
Are you sure you want to change the base?
Conversation
let alice1 = TestContext::new_alice().await; | ||
let alice2 = TestContext::new_alice().await; | ||
|
||
alice1.set_config_bool(Config::IsChatmail, true).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also test for non-chatmail, this should work for non-chatmail too.
alice1.set_config_bool(Config::SyncMsgs, true).await?; | ||
alice2.set_config_bool(Config::SyncMsgs, true).await?; | ||
|
||
alice1.set_config_bool(Config::BccSelf, true).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also check that alice2 has BccSelf
disabled. In case of non-chatmail, disable it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for SyncMsgs
says:
/// Enable sending and executing (applying) sync messages. Sending requires `BccSelf` to be set
/// and `Bot` unset.
I think it should now reflect that sending sync messages is auto-enabled on receipt of a sync message because BccSelf
is auto-enabled. And the documentation for BccSelf
as well.
|
||
// Since there was a sync message, we know that there is a second device. | ||
// Set BccSelf to true if it isn't already. | ||
if !items.items.is_empty() && !self.get_config_bool(Config::BccSelf).await.unwrap_or(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!= Ok(true)
is easier to read, but i'd make it == Ok(false)
, i think we don't want to set the config on failures.
as @iequidoo meanwhile figured out a possible concrete reason for the bug and did an on-point-fix at #6437 - wondering if this mitigation-PR then still makes sense, knowing it contains network thingies and may result in other bugs :) i am +/-0 here, i just want to raise the question :) |
I tried to remember why currently we apply sync messages if |
Fix #6433
I at first only wanted to do it any outgoing messages, but @link2xt was concerned that this may accidentally enable bcc_self, e.g. if:
If more people report the bug, then we should do it for any outgoing messages and/or revert #6344 (except for the migration).