-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Share Megolm session keys when inviting a new user #5853
Share Megolm session keys when inviting a new user #5853
Conversation
matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
Outdated
Show resolved
Hide resolved
}.mapCatching { | ||
val userDevices = cryptoStore.getUserDevices(userId) | ||
userDevices?.forEach { | ||
// Lets share the provided inbound sessions for every user device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general comment for the comments, they look like they could be replaced with functions
// Get inbound session from sessionId and sessionKey
sessionInfoSet?.inboundSessions()
// Filter only sessions with sharedHistory enabled
?.onlySessionsWithSharedHistory()
// Share the session to userId with deviceId
fun shareSessionWithUserDevice(session, roomId, userId, deviceId)
...sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/IMXDecrypting.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/matrix/android/sdk/internal/crypto/model/OlmInboundGroupSessionWrapper2.kt
Outdated
Show resolved
Hide resolved
...ain/java/org/matrix/android/sdk/internal/session/room/membership/DefaultMembershipService.kt
Outdated
Show resolved
Hide resolved
...k-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ChunkEntityHelper.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/crypto/CryptoService.kt
Outdated
Show resolved
Hide resolved
...src/main/java/org/matrix/android/sdk/internal/crypto/algorithms/megolm/MXMegolmDecryption.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
Outdated
Show resolved
Hide resolved
...k-android/src/main/java/org/matrix/android/sdk/internal/database/helper/ChunkEntityHelper.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the PR 👏
Please see my comments. Also it would be good to add a bit more log (.debug level to keep track on what hapenned in RS, and .verbose to help debugging).
I think the part in MXMegolmDecryption would need some rework because I refactored part of it in my latest PR, we could check that together when it will be merged.
...x-sdk-android/src/androidTest/java/org/matrix/android/sdk/internal/crypto/E2eeSanityTests.kt
Outdated
Show resolved
Hide resolved
matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/DefaultCryptoService.kt
Outdated
Show resolved
Hide resolved
464ad55
to
607c959
Compare
This PR #5559 should be merged first |
607c959
to
d9f64ad
Compare
Pushed an update with changed needed to have polyjuice test passing. Migrated the Moved things around a bit and rebased after latest SDK PR #5492 @ariskotsomitopoulos I think we should review the way we get the last messages of the timeline. We could add a new API in timeline service. This could be usefull for other features, like redact the n last message of someone (when moderating) |
@ariskotsomitopoulos One last thing to add is the export/import to backup and file:
|
Oh also @ariskotsomitopoulos , please add a configuration flag in MXCryptoConfig to enable/disable history sahring. |
Add shared_history flag to sessionBackupData
a196a52
to
fb5f0cb
Compare
SonarCloud Quality Gate failed. |
Is there a way to enable sharing the whole history? On my server this performance is not so important |
Just to make sure, any updates on this? The Labs feature is disabled for be, not sure exactly why. Are there plans to move this forward? Are there any replacements in the meantime? Thanks so much for your work! ❤️ |
Closes #4153 and relates to MSC3061
This PR aims to improve users experience when they are first invited to a room. Users will be able to decrypt and view previous messages
PR includes:
sharedHistory
in inbound Megolm sessions. That flag will determine whether or not the inbound session will be shared. That flag respects the room history visibility settings at the time:world_readable
-> sharedHistory = trueshared
-> sharedHistory = trueinvited
-> sharedHistory = falsejoined
-> sharedHistory = falseUpdate
Added MSC3061 as a lab flag (off by default).
Enabling it will trigger an initial sync.
Crypto database have been migrated to stop using frozen serializable java objects for session metadata (using json now)