Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add a checkpoint to index newly encrypted rooms. #4611

Merged
merged 5 commits into from
Jun 19, 2020

Conversation

poljar
Copy link
Contributor

@poljar poljar commented May 21, 2020

This intends to fix element-hq/element-web#13682, it waits for m.room.encryption events in the timeline and indexes a room if one is received. Though if a limited timeline was received the m.room.encryption event will be missed.

A suggestion was made to use the RoomState.events event and catch a m.room.encryption event there, but due to the way our locally cached sync gets stored/restored that event will be fired every time Riot gets started.

Suggestions on how to handle a limited sync there are welcome.

@poljar poljar requested a review from a team May 21, 2020 11:04
@dbkr
Copy link
Member

dbkr commented May 26, 2020

Hmm, but won't this equally apply to rooms that have an m.room.encryption event in recent history when starting up, ie. the event will still get replayed? Using RoomState.events does sound like the correct answer, but you will need to check whether you've already started indexing a room. You'll also need to ensure the room is actually encrypted as this will just look for an encryption event with any algorithm which could be one we don't understand. Hopefully you can do this by checking isRoomEncrypted (if that's up to date when you get the event).

@poljar
Copy link
Contributor Author

poljar commented May 26, 2020

Hmm, but won't this equally apply to rooms that have an m.room.encryption event in recent history when starting up, ie. the event will still get replayed?

I don't think I observed that happening, but will re-check.

Using RoomState.events does sound like the correct answer, but you will need to check whether you've already started indexing a room.

That's a bit annoying, that'll need a new method in Seshat but I guess other people might find it useful as well.

@jryans
Copy link
Collaborator

jryans commented Jun 2, 2020

@poljar Do you plan to revise this, or were you waiting for a review here? I wasn't sure if the above:

That's a bit annoying, that'll need a new method in Seshat but I guess other people might find it useful as well.

...meant you would revise this to address that, or if you see it as future work...?

@poljar
Copy link
Contributor Author

poljar commented Jun 2, 2020

I meant that I'll add the feature to Seshat and I'll update this PR after Seshat gets support. It's just a bit stuck behind getting the paginated search going and keeping the rust-sdk rolling.

@jryans
Copy link
Collaborator

jryans commented Jun 2, 2020

Okay, for now I'll clear the review request here then.

@jryans jryans removed the request for review from a team June 2, 2020 10:48
@poljar
Copy link
Contributor Author

poljar commented Jun 8, 2020

This has now been updated, it requires the following PRs:
matrix-org/seshat#65
element-hq/element-web#13957
element-hq/element-desktop#100

Also a Seshat release will be required.

@poljar poljar requested a review from a team June 8, 2020 15:39
Copy link
Collaborator

@jryans jryans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me! 😄

@poljar poljar merged commit 253212d into develop Jun 19, 2020
@poljar poljar deleted the poljar/eventindex-new-encrypted-rooom branch June 21, 2020 17:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

In rooms with E2E encryption, older unencrypted messages can't be searched
3 participants