element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
GNU Affero General Public License v3.0
425 stars 102 forks source link

Msgs from freshly logged in & verified device all appear red shield (unknown/deleted device) #3207

Closed ara4n closed 1 month ago

ara4n commented 2 months ago

Steps to reproduce

  1. @dkasak got kicked out of ED due to diskfill
  2. he logged in again
  3. he verified himself
  4. he sent me msgs
  5. all msgs appear red shield, saying unknown/deleted device:
EventTimelineItem {
    sender: "@dkasak:termina.org.uk",
    sender_profile: Ready(
        Profile {
            display_name: Some(
                "dkasak",
            ),
            display_name_ambiguous: false,
            avatar_url: Some(
                "mxc://termina.org.uk/GZLyTGACVOyuzABpftmsbEoA",
            ),
        },
    ),
    timestamp: 2024-08-28T10:20:52.582,
    content: Message(
        Message {
            in_reply_to: None,
            thread_root: None,
            edited: false,
            ..
        },
    ),
    kind: Remote(
        RemoteEventTimelineItem {
            event_id: "$wEkpsJXF-aHe_1JtBuXgGQ96sepyAiXs-AecmA7gEDM",
            transaction_id: None,
            reactions: ReactionsByKeyBySender(
                {},
            ),
            read_receipts: {
                "@dkasak:termina.org.uk": Receipt {
                    ts: Some(
                        2024-08-28T10:20:52.582,
                    ),
                    thread: Unthreaded,
                },
            },
            is_own: false,
            is_highlighted: false,
            encryption_info: Some(
                EncryptionInfo {
                    sender: "@dkasak:termina.org.uk",
                    sender_device: None,
                    algorithm_info: MegolmV1AesSha2 {
                        curve25519_key: "RrlyfC1gE6/6W4aAwKvkvm/m1Xh1sF9oqfSQsznwrCU",
                        sender_claimed_keys: {
                            "ed25519": "BlOdE9LrIkjDxnutdUgNkO76hTDjt7ERrQNi0vVfgaI",
                        },
                    },
                    verification_state: Unverified(
                        None(
                            MissingDevice,
                        ),
                    ),
                },
            ),
            origin: Cache,
            ..
        },
    ),
    is_room_encrypted: Some(
        true,
    ),
}

{
  "sender" : "@dkasak:termina.org.uk",
  "content" : {
    "msgtype" : "m.text",
    "m.mentions" : {

    },
    "body" : "Is there a Github issue yet? So I can link to it"
  },
  "origin_server_ts" : 1724840452582,
  "room_id" : "!OGifaQdQLDehNVdZpK:termina.org.uk",
  "event_id" : "$wEkpsJXF-aHe_1JtBuXgGQ96sepyAiXs-AecmA7gEDM",
  "type" : "m.room.message",
  "unsigned" : {
    "membership" : "join"
  }
}

Outcome

What did you expect?

accurate shields

What happened instead?

some kind of devicelist or caching bug (sss is on, ftr)

Your phone model

No response

Operating system version

No response

Application version

690

Homeserver

No response

Will you send logs?

Yes

ara4n commented 2 months ago

this looks like it is also causing utds from me to dkasak, perhaps predictably

BillCarsonFr commented 2 months ago

@ara4n Do you still see red shields after a kill/restart?

ara4n commented 2 months ago

nope. they fixed after a restart.

BillCarsonFr commented 1 month ago

So my understanding is that it's a not yet downloaded device (so not a deleted device, but rather it is not yet known and in the process of beeing downloaded).

This should not happen if the sender is using a recent sdk implementing https://github.com/matrix-org/matrix-rust-sdk/pull/3517

If it's not the case (classic android/ios or a not udpated web), it could happen but would now resolve quickly due to https://github.com/matrix-org/matrix-rust-sdk/issues/3751

Closing now as cannot reproduce (I think because now all the changes have landed)