Why did I lose encryption to the user in a secondary chat?

Delta Chat version

Delta Chat Desktop 2.9.0 (git: v2.9.0-5-g859253929-update-application-config-for-freebsd)
Delta Chat Core v2.9.0
SQLite 3.46.1
electron 35.7.0
node 22.16.0

The git commit is the pull request #5351 to add FreeBSD

Expected behavior

On the iOS app, only one chat is visible with all the messages to a particular user

Probably I should have only one chat with the user also on the desktop version?

Actual behavior

I have two chats open with the same user (I don’t know why I have two) on deltachat-desktop app.

Two days ago I could send a message to that user (on the newer chat) without any problems.

Today, after reinstalling delta-rpc-server after not using for some time, I noticed that the newer (second) chat has an envelope and “no encryption”. I cannot send the messages due to this:

644.9s [w]core/event: 1 src/mimefactory.rs:335: Missing key for *****@nine.testrun.org

Sending via the older (first) chat seems to be fine.

Why did the chats diverged and why one stopped working?

Summary
> /usr/local/bin/sqlite3 -readonly accounts/e02cb0de-bf7a-4fc4-8823-08d651224237/dc.db          
SQLite version 3.50.2 2025-06-28 14:00:48
Enter ".help" for usage hints.
sqlite> .mode line
sqlite> select * from contacts where authname like 'Redacteduser%';
             id = 10
           name = 
           addr = redactedrandomid@nine.testrun.org
         origin = 16384
        blocked = 0
      last_seen = 1755541943
          param = J=1755541747
j=1755541763
       authname = Redacteduser
selfavatar_sent = 1755541852
         status = 
         is_bot = 0
    fingerprint = 
       verifier = 0

             id = 13
           name = 
           addr = redactedrandomid@nine.testrun.org
         origin = 16777216
        blocked = 0
      last_seen = 1754139863
          param = J=1753880770
j=1753880770
       authname = Redacteduser
selfavatar_sent = 1755697781
         status = 
         is_bot = 0
    fingerprint = 15FB0ADBC38F49F780F2C4763E2FAA07086FC1E0
       verifier = 1

sqlite> select * from key_contacts_map where old_id in (10,13);
old_id = 10
new_id = 13

sqlite> select * from gossip_timestamp;
    chat_id = 12
fingerprint = 15FB0ADBC38F49F780F2C4763E2FAA07086FC1E0
  timestamp = 1755697780

    chat_id = 13
fingerprint = 2308C221F5B7403CE990C06F240C7E0EA369B0D5
  timestamp = 1754233784

    chat_id = 14
fingerprint = 15FB0ADBC38F49F780F2C4763E2FAA07086FC1E0
  timestamp = 1755415904

Having one unencrypted chat for address-contact and zero or more encrypted chats with the key is expected in 2.x. Except that you somehow don’t have a key for the contact. Receiving a message from this contact with attached key should help and make encrypted 1:1 chat usable.

Why did the chat was encrypted until last Monday, August 18th? The messages got sent and received as shown on the screenshot below:

This is very confusing! Some other contact has a single chat only.