element-hq / element-android

A Matrix collaboration client for Android.
https://element.io/
Apache License 2.0
3.31k stars 702 forks source link

Android clients hides room history from newly invited users in a room #4503

Open daniellekirkwood opened 2 years ago

daniellekirkwood commented 2 years ago

Steps to reproduce

Our customers are complaining that export of room history does not work. They expect to have new users in a room be able to see the complete message history of the room, but previous history doesn't load automatically when joining the room, and there is no sign or indications of loading nor any errors.


Repro:
Prerequisite:

  1. Need multiple users
  2. Web users & Mobile device user (Android)

Issue (1)

Issue (2)

New web user can only see messages AFTER the message Android user sent. IOW messages sent earlier that the first Android message will be excluded from the room history.

Outcome

What did you expect?

What happened instead?

Your phone model

No response

Operating system version

No response

Application version and app store

No response

Homeserver

No response

Will you send logs?

No

manuroe commented 2 years ago

I think this is because of the lack of MSC3061: Sharing room keys for past messages on android (and ios).

Existing issues:

thoraj commented 2 years ago

Even if Element iOS or Android does not support key sharing yet, their presence in a room should not prevent web users from sharing keys?

It sounds like these are two separate issues:

  1. Presence of Android (and iOS?) devices in a room prevents key sharing between Element Web clients
  2. Android and iOS devices do not support sharing keys
benparsons commented 2 years ago

I see this has been moved to Need info - what info is needed, and from whom?

daniellekirkwood commented 2 years ago

We believe this is a Crypto issue and would fall to @BillCarsonFr and team.

@BillCarsonFr is that right, what can we do to help you with this?

BillCarsonFr commented 2 years ago

I have to check, if by 'hides history' you mean that the message are not displayed, it's a timeline issue to be handled by platform. If by hides history you mean that the events can't be decrypted it's expected as per @manuroe comment because sharing key history not implemented on mobile.

But this need some investigation, try to reproduce and provide more details / screenshots, hard to understand as is without investigation

thoraj commented 2 years ago

The symptom is that messages are not shown in the room history on the web client. The assumption is that Element Web hides the messages it is not able to decrypt.

Also note that the issue is NOT that Android (or iOS clients cannot view history). The issue is:

If a room has only Element Web devices, key sharing works as expected. I.e. newly invited users can indeed see the history in the room.

BUT if an Android device gets into the room, the next web device which gets invited to the room will NOT be able to see the history.

thoraj commented 2 years ago

@BillCarsonFr Are you not seeing the issue when following the repro steps?

BillCarsonFr commented 2 years ago

Out of curiousity if you go to settings > Advanced and enable show all history

image

Are the messages in fail to decrypt?

BillCarsonFr commented 2 years ago

It all look like the same bug and it's on web. Probably some bugs in the code that was made to hide history of e2e rooms (as you were not suppose to see it previous to this share history feature).

Try to reply to an old message that the last web don't see. Then on the last web tap on the embedded reply, the timeline flickers a bit and we can see the room create tile for a second and then the timeline is laggy

I would be in favor to close here and open an issue on web

BillCarsonFr commented 2 years ago

Regarding the android part, it should be fixed when This will be implemented vector-im/element-web#4153 (Sharing room keys for past messages )

And this https://github.com/vector-im/element-android/pull/2190 will be tweaked to enable back pagination if history is shared and also show event and request keys.

BillCarsonFr commented 2 years ago

I would be in favor to close here and open an issue on web

So we can keep this open for android (we have now to enable back showing history and backpaginating when history is shared and query keys).

A separate issue must be open on web regarding the display/pagination issue

BillCarsonFr commented 2 years ago

As seen with @duxovni Web issues already exists:

https://github.com/vector-im/element-meta/issues/647 https://github.com/vector-im/element-web/issues/16983

emmaburton1 commented 2 years ago

Regarding the android part, it should be fixed when This will be implemented vector-im/element-web#4153 (Sharing room keys for past messages )

And this vector-im/element-web#2190 will be tweaked to enable back pagination if history is shared and also show event and request keys.

Looks like vector-im/element-web#4153 is now closed. What does that mean for the status of this bug?

Florian14 commented 2 years ago

@daniellekirkwood according to @BillCarsonFr comment, it should be fixed now, can you test again?