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

Fix sending note to self as primary without secondary devices #339

Merged
merged 5 commits into from
Oct 26, 2024

Conversation

gferon
Copy link
Collaborator

@gferon gferon commented Oct 22, 2024

There might be a better way to do this but... here's what happens:

  1. Register a client as primary (no extra devices)
  2. Try to send a message to self which will try to call create_encrypted_message but will never send any messages because we purposefully skip sending messages to ourselves (and own device) for good reasons
  3. At the very end of the process, we fetch the identity_key (public key) we have for the recipient, which fails because we've never established a session with ourselves (this would only happen if we have other devices).

Here are two improvements:

  • When the result of create_encrypted_messages return 0 messages, do nothing
  • ...and check that we're is_multi_device before even attempting to craft and send a SyncMessage to self (that was missed when doing Only send a SyncMessage when sending to self #338)

@gferon gferon marked this pull request as draft October 22, 2024 21:45
@gferon gferon force-pushed the fix-note-to-self-primary branch 2 times, most recently from 0a8964f to 7998c8a Compare October 22, 2024 21:50
@gferon gferon marked this pull request as ready for review October 22, 2024 21:51
@gferon gferon requested a review from rubdos October 22, 2024 21:51
@gferon gferon force-pushed the fix-note-to-self-primary branch from 7998c8a to 0379bf3 Compare October 22, 2024 21:52
@gferon gferon force-pushed the fix-note-to-self-primary branch from f096e52 to fb5196a Compare October 23, 2024 08:07
@gferon gferon requested a review from direc85 October 23, 2024 08:07
src/sender.rs Show resolved Hide resolved
@gferon gferon merged commit b6b9cf3 into main Oct 26, 2024
7 checks passed
@gferon gferon deleted the fix-note-to-self-primary branch October 26, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants