Skip to content

Conversation

iequidoo
Copy link
Collaborator

See commit messages.
NB: Self-removal from unencrypted (ad hoc) groups returns an error now, otherwise remaining members won't know about it. It should be disabled in UIs and the user should resolve it on their own (e.g. by asking other members).

iequidoo added 3 commits June 23, 2025 19:43
Unencrypted groups are usually ones with other MUAs which don't understand Delta Chat system
messages and show them as weird emails.
Unencrypted groups are usually ones with other MUAs which don't understand Delta Chat system
messages and show them as weird emails.

Self-removal returns an error now, otherwise remaining members won't know about it. It should be
disabled in UIs and the user should resolve it on their own (e.g. by asking other members).
@link2xt
Copy link
Collaborator

link2xt commented Jun 25, 2025

The other problem with this idea is that if you remove or add members, but then don't send any messages, e.g. because you have drafted something but never finished, you have still updated the timestamps of the members. And by the time you send the message, the timestamp of the change is not the current timestamp, but the timestamp of when you have added the member.

@iequidoo
Copy link
Collaborator Author

It's still better than just missing functionality and most of the time it'll work as expected, an exception is if you e.g. added a member A, but another member added and removed A while you were drafting, and situations like this. The problem already exists for encrypted groups when you're offline and add a member and then draft and send a message.

Maybe it's even good to send the old timestamp. If the user never finishes the draft and just forgets about the modification (moreover, no system message is added), the old timestamp may have no effect at all.

@iequidoo
Copy link
Collaborator Author

An unwanted race is found however, citing @link2xt:

if you add/remove members but don't send anything, there are invisible member timestamps that are still updated even if you revert the change.

@iequidoo
Copy link
Collaborator Author

iequidoo commented Jun 29, 2025

Another unwanted race: if the user renames a group but receives another group rename while drafting a message, the user's group name change is lost.

Now i think all this is better to be done by cloning unencrypted groups. That would be much closer to what classical MUAs do by providing message trees. But cloning should be implemented in Core apparently, it should include the replied message in the new chat at least and preserve the chat name. Maybe instead of the current "Clone Chat" we should add "Extended Reply" to the message menu and if the chat name/members are modified, the reply goes to a new chat. Also, for symmetry, messages with unencrypted group name or member changes should go to a new unencrypted chat. This will resolve a race when the user sends a message and it goes to wrong recipients because of membership changes just arrived. Maybe we even should remove message assignment by In-Reply-To/References then because we also have assignment by group name + member list now (see lookup_chat_or_create_adhoc_group()) which exactly provides the necessary behavior. All this would give to the user a precise control over messages like in classical MUAs at the cost of some chat duplication.

@iequidoo iequidoo closed this Jun 30, 2025
@missytake
Copy link
Contributor

What if we set a new recipient list + subject only in the client, and only send it to core when a message draft is started? And then don't let an incoming message override the changed parameters while a draft is set?

I think cloning chats is not what users want here, because then the conversation is split up among several chats and you can't see the whole topic at one glance anymore. E-Mail is about Thread-based communication after all, not about membership-based communication like chat.

Added recipients are an exception, those you might want to include in CC if someone just introduced them. We could let adding recipients happen even if a draft is set. Then again - it's not so bad if someone isn't included in CC, that happens all the time in the email world; it will just be messy to display. If a subject change is lost due to the race that doesn't matter so much, but an added recipient...

@iequidoo
Copy link
Collaborator Author

What if we set a new recipient list + subject only in the client, and only send it to core when a message draft is started? And then don't let an incoming message override the changed parameters while a draft is set?

Then various race conditions are still possible because we don't apply incoming changes to the group for some time and they may conflict with local changes or with undoing of local changes.

Maybe smth simpler works here instead of accumulating changes locally, e.g.:

  • When adding a new member, we just forward the last chat message (maybe only text) to all members + the new one. In the UIs "Add members" should be renamed to "Add members (forwards last message)". Most of the time this is what you want to let the new member have some context. Maybe the last user's message should be forwarded to avoid forwarding of just arrived random messages. Then you can optionally write "I want to introduce Alice" and add her (the message will be duplicated in the chat, but it makes no harm).
  • The same for removing a member, currently the UI asks "Remove Alice from group?", it should be appended with "(forwards last message to other members)". Could send a draft instead, but that would be more complex (the draft shouldn't be cleared because you may want to remove several members) and also Alice wouldn't see this last message, so you can't put an explanation about her removal into it.
  • But renaming a group may be just an empty message that contains a new Subject. It's not what is used frequently anyway and overall looks acceptable.

By not accumulating local changes we make less differences here with Delta Chat encrypted groups, particularly in relation to group membership and name consistency algorithm.

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.

3 participants