Skip to content

feat: Migrate unencrypted contacts to be read-only - #8808

Draft
Hocuri wants to merge 3 commits into
mainfrom
hoc/remove-unencrypted
Draft

Hocuri wants to merge 3 commits into
mainfrom
hoc/remove-unencrypted

Conversation

@Hocuri

@Hocuri Hocuri commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #8775

TODO:

Things I considered but didn't implement:

  • Rather than removing all members from ad-hoc groups, we could remove only ContactID::SELF. This would be enough for making them read-only, but it doesn't really matter. The sender of a message can be seen by tapping on the sender avatar of a message.
  • Inline create_and_deduplicate_from_bytes() so that the migration doesn't depend on external code. Seems fine as-is; if we ever remove create_and_deduplicate_from_bytes(), we can just remove the respective code from the migration.

Future possibilities (please comment if we should do some of them already):

  • Give all of the ad-hoc groups a fake group ID, so that we don't need any special code for handling empty group IDs

    • If so, need to test what happens when the group ID is not the same on different devices, and then the user pins the chat on one of the devices
      • E.g. we might use the newest msgid as an identifier, which will often/sometimes be the same on different devices:
        UPDATE chats
        SET grpid='legacy_group_' || coalesce(
            (SELECT NULLIF(rfc724_mid, '') FROM msgs WHERE chat_id=chats.id ORDER BY id DESC LIMIT 1),
            hex(randomblob(16))
        )
        WHERE id IN (SELECT chat_id FROM legacy_unencrypted_chats) AND grpid='';
        
  • Similarly, give all of the address-contacts a fake fingerprint

@Hocuri
Hocuri marked this pull request as draft October 7, 2026 08:55
@Hocuri Hocuri changed the title Migrate unencrypted contacts to be read-only feat: Migrate unencrypted contacts to be read-only Oct 7, 2026
@Hocuri
Hocuri force-pushed the hoc/remove-unencrypted branch 6 times, most recently from 13b4720 to b5acd08 Compare October 8, 2026 14:23
In its stead, remove `recode_avatar` high-level migration. It was added
5 years ago, and even if someone updates Delta Chat after such a long
time, large avatars are not a problem anymore since we don't send them
in unencrypted messages.
@Hocuri
Hocuri force-pushed the hoc/remove-unencrypted branch from b5acd08 to 71d920b Compare October 13, 2026 11:53

This branch has not been deployed

No deployments
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.

1 participant