matrix-js-sdk 41.8.0 → 41.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js +3 -1
- package/lib/@types/IIdentityServerProvider.js +3 -1
- package/lib/@types/PushRules.js +7 -7
- package/lib/@types/PushRules.js.map +1 -1
- package/lib/@types/auth.js +4 -4
- package/lib/@types/auth.js.map +1 -1
- package/lib/@types/beacon.js +2 -2
- package/lib/@types/beacon.js.map +1 -1
- package/lib/@types/common.js +3 -1
- package/lib/@types/crypto.js +3 -1
- package/lib/@types/event.js +20 -20
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/events.js +3 -1
- package/lib/@types/extensible_events.js +6 -6
- package/lib/@types/extensible_events.js.map +1 -1
- package/lib/@types/global.d.js.map +1 -1
- package/lib/@types/json.js +3 -1
- package/lib/@types/local_notifications.js +3 -1
- package/lib/@types/location.js +4 -4
- package/lib/@types/location.js.map +1 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +3 -1
- package/lib/@types/media.js +3 -1
- package/lib/@types/membership.js +1 -1
- package/lib/@types/membership.js.map +1 -1
- package/lib/@types/partials.js +6 -6
- package/lib/@types/partials.js.map +1 -1
- package/lib/@types/polls.js +5 -5
- package/lib/@types/polls.js.map +1 -1
- package/lib/@types/read_receipts.js +2 -2
- package/lib/@types/read_receipts.js.map +1 -1
- package/lib/@types/registration.js +3 -1
- package/lib/@types/requests.js +1 -1
- package/lib/@types/requests.js.map +1 -1
- package/lib/@types/retention.js +1 -1
- package/lib/@types/retention.js.map +1 -1
- package/lib/@types/search.js +1 -1
- package/lib/@types/search.js.map +1 -1
- package/lib/@types/signed.js +3 -1
- package/lib/@types/spaces.js +3 -1
- package/lib/@types/state_events.js +3 -1
- package/lib/@types/synapse.js +3 -1
- package/lib/@types/sync.js +1 -1
- package/lib/@types/sync.js.map +1 -1
- package/lib/@types/threepids.js +1 -1
- package/lib/@types/threepids.js.map +1 -1
- package/lib/@types/topic.js +1 -1
- package/lib/@types/topic.js.map +1 -1
- package/lib/@types/uia.js +3 -1
- package/lib/NamespacedValue.js +8 -8
- package/lib/NamespacedValue.js.map +1 -1
- package/lib/ReEmitter.js +9 -16
- package/lib/ReEmitter.js.map +1 -1
- package/lib/ToDeviceMessageQueue.js +49 -57
- package/lib/ToDeviceMessageQueue.js.map +1 -1
- package/lib/autodiscovery.js +232 -247
- package/lib/autodiscovery.js.map +1 -1
- package/lib/base64.js +1 -1
- package/lib/base64.js.map +1 -1
- package/lib/browser-index.d.ts +2 -2
- package/lib/browser-index.d.ts.map +1 -1
- package/lib/browser-index.js +5 -5
- package/lib/browser-index.js.map +1 -1
- package/lib/capabilityPoller.js +19 -22
- package/lib/capabilityPoller.js.map +1 -1
- package/lib/client.d.ts +2 -8
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +2043 -2487
- package/lib/client.js.map +1 -1
- package/lib/common-crypto/CryptoBackend.js +2 -2
- package/lib/common-crypto/CryptoBackend.js.map +1 -1
- package/lib/common-crypto/key-passphrase.js.map +1 -1
- package/lib/content-helpers.js +43 -48
- package/lib/content-helpers.js.map +1 -1
- package/lib/content-repo.js +14 -24
- package/lib/content-repo.js.map +1 -1
- package/lib/crypto/store/base.js +6 -6
- package/lib/crypto/store/base.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +190 -238
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +1 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +25 -30
- package/lib/crypto/store/indexeddb-crypto-store.js.map +1 -1
- package/lib/crypto/store/localStorage-crypto-store.js +113 -145
- package/lib/crypto/store/localStorage-crypto-store.js.map +1 -1
- package/lib/crypto/store/memory-crypto-store.js +74 -105
- package/lib/crypto/store/memory-crypto-store.js.map +1 -1
- package/lib/crypto-api/CryptoEvent.js +1 -1
- package/lib/crypto-api/CryptoEvent.js.map +1 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js +3 -1
- package/lib/crypto-api/index.d.ts +15 -6
- package/lib/crypto-api/index.d.ts.map +1 -1
- package/lib/crypto-api/index.js +22 -22
- package/lib/crypto-api/index.js.map +1 -1
- package/lib/crypto-api/key-passphrase.js +15 -23
- package/lib/crypto-api/key-passphrase.js.map +1 -1
- package/lib/crypto-api/keybackup.js +3 -1
- package/lib/crypto-api/recovery-key.js +11 -12
- package/lib/crypto-api/recovery-key.js.map +1 -1
- package/lib/crypto-api/verification.js +3 -3
- package/lib/crypto-api/verification.js.map +1 -1
- package/lib/digest.js +7 -14
- package/lib/digest.js.map +1 -1
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +380 -505
- package/lib/embedded.js.map +1 -1
- package/lib/errors.js +2 -2
- package/lib/errors.js.map +1 -1
- package/lib/event-mapper.js +10 -12
- package/lib/event-mapper.js.map +1 -1
- package/lib/extensible_events_v1/ExtensibleEvent.js.map +1 -1
- package/lib/extensible_events_v1/InvalidEventError.js.map +1 -1
- package/lib/extensible_events_v1/MessageEvent.js +11 -13
- package/lib/extensible_events_v1/MessageEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollEndEvent.js +3 -4
- package/lib/extensible_events_v1/PollEndEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollResponseEvent.js +5 -6
- package/lib/extensible_events_v1/PollResponseEvent.js.map +1 -1
- package/lib/extensible_events_v1/PollStartEvent.js +8 -10
- package/lib/extensible_events_v1/PollStartEvent.js.map +1 -1
- package/lib/extensible_events_v1/utilities.js.map +1 -1
- package/lib/feature.js +18 -31
- package/lib/feature.js.map +1 -1
- package/lib/filter-component.d.ts.map +1 -1
- package/lib/filter-component.js +20 -26
- package/lib/filter-component.js.map +1 -1
- package/lib/filter.js +14 -17
- package/lib/filter.js.map +1 -1
- package/lib/http-api/errors.js +28 -43
- package/lib/http-api/errors.js.map +1 -1
- package/lib/http-api/fetch.js +141 -159
- package/lib/http-api/fetch.js.map +1 -1
- package/lib/http-api/index.js +17 -20
- package/lib/http-api/index.js.map +1 -1
- package/lib/http-api/interface.js +1 -1
- package/lib/http-api/interface.js.map +1 -1
- package/lib/http-api/method.js +1 -1
- package/lib/http-api/method.js.map +1 -1
- package/lib/http-api/prefix.js +3 -3
- package/lib/http-api/prefix.js.map +1 -1
- package/lib/http-api/refresh.js +74 -94
- package/lib/http-api/refresh.js.map +1 -1
- package/lib/http-api/utils.d.ts +1 -1
- package/lib/http-api/utils.d.ts.map +1 -1
- package/lib/http-api/utils.js +34 -42
- package/lib/http-api/utils.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/indexeddb-helpers.js +3 -3
- package/lib/indexeddb-helpers.js.map +1 -1
- package/lib/indexeddb-worker.js.map +1 -1
- package/lib/interactive-auth.d.ts +5 -5
- package/lib/interactive-auth.d.ts.map +1 -1
- package/lib/interactive-auth.js +172 -204
- package/lib/interactive-auth.js.map +1 -1
- package/lib/logger.js +21 -57
- package/lib/logger.js.map +1 -1
- package/lib/matrix.js +7 -11
- package/lib/matrix.js.map +1 -1
- package/lib/matrixrtc/CallMembership.js +80 -74
- package/lib/matrixrtc/CallMembership.js.map +1 -1
- package/lib/matrixrtc/EncryptionManager.js +1 -1
- package/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/lib/matrixrtc/IKeyTransport.js +1 -1
- package/lib/matrixrtc/IKeyTransport.js.map +1 -1
- package/lib/matrixrtc/IMembershipManager.js +1 -1
- package/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/lib/matrixrtc/LivekitTransport.d.ts +1 -1
- package/lib/matrixrtc/LivekitTransport.js +4 -4
- package/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.js +137 -187
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js +36 -41
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -1
- package/lib/matrixrtc/MembershipManager.js +332 -378
- package/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/lib/matrixrtc/MembershipManagerActionScheduler.js +54 -63
- package/lib/matrixrtc/MembershipManagerActionScheduler.js.map +1 -1
- package/lib/matrixrtc/RTCEncryptionManager.js +119 -143
- package/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/lib/matrixrtc/ToDeviceKeyTransport.js +53 -58
- package/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/lib/matrixrtc/index.js.map +1 -1
- package/lib/matrixrtc/membershipData/common.js +1 -1
- package/lib/matrixrtc/membershipData/common.js.map +1 -1
- package/lib/matrixrtc/membershipData/index.js.map +1 -1
- package/lib/matrixrtc/membershipData/rtc.js +15 -23
- package/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/lib/matrixrtc/membershipData/session.js +4 -5
- package/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/lib/matrixrtc/types.js +4 -6
- package/lib/matrixrtc/types.js.map +1 -1
- package/lib/matrixrtc/utils.js +4 -11
- package/lib/matrixrtc/utils.js.map +1 -1
- package/lib/models/MSC3089Branch.js +91 -116
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/MSC3089TreeSpace.js +209 -245
- package/lib/models/MSC3089TreeSpace.js.map +1 -1
- package/lib/models/ToDeviceMessage.js +3 -1
- package/lib/models/beacon.js +14 -13
- package/lib/models/beacon.js.map +1 -1
- package/lib/models/compare-event-ordering.js +13 -13
- package/lib/models/compare-event-ordering.js.map +1 -1
- package/lib/models/device.js +3 -3
- package/lib/models/device.js.map +1 -1
- package/lib/models/event-context.js +5 -8
- package/lib/models/event-context.js.map +1 -1
- package/lib/models/event-status.js +1 -1
- package/lib/models/event-status.js.map +1 -1
- package/lib/models/event-timeline-set.js +88 -94
- package/lib/models/event-timeline-set.js.map +1 -1
- package/lib/models/event-timeline.js +28 -30
- package/lib/models/event-timeline.js.map +1 -1
- package/lib/models/event.js +182 -226
- package/lib/models/event.js.map +1 -1
- package/lib/models/invites-ignorer-types.js +4 -4
- package/lib/models/invites-ignorer-types.js.map +1 -1
- package/lib/models/invites-ignorer.js +159 -179
- package/lib/models/invites-ignorer.js.map +1 -1
- package/lib/models/poll.js +71 -81
- package/lib/models/poll.js.map +1 -1
- package/lib/models/profile-keys.js +2 -2
- package/lib/models/profile-keys.js.map +1 -1
- package/lib/models/read-receipt.js +40 -56
- package/lib/models/read-receipt.js.map +1 -1
- package/lib/models/related-relations.js.map +1 -1
- package/lib/models/relations-container.js +22 -23
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.js +133 -159
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-member.js +24 -29
- package/lib/models/room-member.js.map +1 -1
- package/lib/models/room-receipts.js +29 -43
- package/lib/models/room-receipts.js.map +1 -1
- package/lib/models/room-retention.js +74 -83
- package/lib/models/room-retention.js.map +1 -1
- package/lib/models/room-state.js +143 -172
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room-sticky-events.d.ts +1 -0
- package/lib/models/room-sticky-events.d.ts.map +1 -1
- package/lib/models/room-sticky-events.js +45 -65
- package/lib/models/room-sticky-events.js.map +1 -1
- package/lib/models/room-summary.js.map +1 -1
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +765 -909
- package/lib/models/room.js.map +1 -1
- package/lib/models/search-result.js +5 -5
- package/lib/models/search-result.js.map +1 -1
- package/lib/models/thread.js +225 -285
- package/lib/models/thread.js.map +1 -1
- package/lib/models/typed-event-emitter.js +7 -18
- package/lib/models/typed-event-emitter.js.map +1 -1
- package/lib/models/user.js +8 -8
- package/lib/models/user.js.map +1 -1
- package/lib/oidc/authorize.js +208 -241
- package/lib/oidc/authorize.js.map +1 -1
- package/lib/oidc/discovery.js +23 -36
- package/lib/oidc/discovery.js.map +1 -1
- package/lib/oidc/error.js +1 -1
- package/lib/oidc/error.js.map +1 -1
- package/lib/oidc/index.js +1 -0
- package/lib/oidc/index.js.map +1 -1
- package/lib/oidc/register.js +60 -66
- package/lib/oidc/register.js.map +1 -1
- package/lib/oidc/tokenRefresher.js +77 -91
- package/lib/oidc/tokenRefresher.js.map +1 -1
- package/lib/oidc/validate.js +18 -18
- package/lib/oidc/validate.js.map +1 -1
- package/lib/pushprocessor.js +71 -82
- package/lib/pushprocessor.js.map +1 -1
- package/lib/randomstring.js +9 -9
- package/lib/randomstring.js.map +1 -1
- package/lib/realtime-callbacks.js +25 -28
- package/lib/realtime-callbacks.js.map +1 -1
- package/lib/receipt-accumulator.d.ts +2 -0
- package/lib/receipt-accumulator.d.ts.map +1 -1
- package/lib/receipt-accumulator.js +14 -22
- package/lib/receipt-accumulator.js.map +1 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js +271 -302
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/lib/rendezvous/RendezvousChannel.js +3 -1
- package/lib/rendezvous/RendezvousCode.js +3 -1
- package/lib/rendezvous/RendezvousError.js.map +1 -1
- package/lib/rendezvous/RendezvousFailureReason.js +2 -2
- package/lib/rendezvous/RendezvousFailureReason.js.map +1 -1
- package/lib/rendezvous/RendezvousIntent.js +1 -1
- package/lib/rendezvous/RendezvousIntent.js.map +1 -1
- package/lib/rendezvous/RendezvousTransport.js +3 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +123 -147
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +1 -1
- package/lib/rendezvous/index.js +44 -69
- package/lib/rendezvous/index.js.map +1 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +1 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +134 -152
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +1 -1
- package/lib/retentionPolicy.js +6 -9
- package/lib/retentionPolicy.js.map +1 -1
- package/lib/room-hierarchy.js +52 -60
- package/lib/room-hierarchy.js.map +1 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +94 -104
- package/lib/rust-crypto/CrossSigningIdentity.js.map +1 -1
- package/lib/rust-crypto/DehydratedDeviceManager.js +157 -190
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +1 -1
- package/lib/rust-crypto/KeyClaimManager.js +18 -22
- package/lib/rust-crypto/KeyClaimManager.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +109 -139
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +1 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +66 -80
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +1 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +1 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +196 -224
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +1 -1
- package/lib/rust-crypto/RoomEncryptor.js +127 -143
- package/lib/rust-crypto/RoomEncryptor.js.map +1 -1
- package/lib/rust-crypto/backup.js +453 -549
- package/lib/rust-crypto/backup.js.map +1 -1
- package/lib/rust-crypto/constants.js +1 -1
- package/lib/rust-crypto/constants.js.map +1 -1
- package/lib/rust-crypto/device-converter.js +15 -28
- package/lib/rust-crypto/device-converter.js.map +1 -1
- package/lib/rust-crypto/index.js +103 -116
- package/lib/rust-crypto/index.js.map +1 -1
- package/lib/rust-crypto/libolm_migration.js +303 -365
- package/lib/rust-crypto/libolm_migration.js.map +1 -1
- package/lib/rust-crypto/rust-crypto.d.ts +5 -1
- package/lib/rust-crypto/rust-crypto.d.ts.map +1 -1
- package/lib/rust-crypto/rust-crypto.js +1067 -1332
- package/lib/rust-crypto/rust-crypto.js.map +1 -1
- package/lib/rust-crypto/secret-storage.js +12 -25
- package/lib/rust-crypto/secret-storage.js.map +1 -1
- package/lib/rust-crypto/verification.js +137 -189
- package/lib/rust-crypto/verification.js.map +1 -1
- package/lib/scheduler.js +44 -19
- package/lib/scheduler.js.map +1 -1
- package/lib/secret-storage.js +179 -213
- package/lib/secret-storage.js.map +1 -1
- package/lib/serverCapabilities.js +6 -9
- package/lib/serverCapabilities.js.map +1 -1
- package/lib/service-types.js +1 -1
- package/lib/service-types.js.map +1 -1
- package/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/lib/sliding-sync-sdk.js +368 -424
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sliding-sync.js +135 -171
- package/lib/sliding-sync.js.map +1 -1
- package/lib/store/index.js +3 -1
- package/lib/store/indexeddb-backend.js +3 -1
- package/lib/store/indexeddb-local-backend.js +194 -253
- package/lib/store/indexeddb-local-backend.js.map +1 -1
- package/lib/store/indexeddb-remote-backend.js +33 -63
- package/lib/store/indexeddb-remote-backend.js.map +1 -1
- package/lib/store/indexeddb-store-worker.js +22 -23
- package/lib/store/indexeddb-store-worker.js.map +1 -1
- package/lib/store/indexeddb.js +44 -71
- package/lib/store/indexeddb.js.map +1 -1
- package/lib/store/local-storage-events-emitter.js +2 -2
- package/lib/store/local-storage-events-emitter.js.map +1 -1
- package/lib/store/memory.js +34 -57
- package/lib/store/memory.js.map +1 -1
- package/lib/store/stub.js +22 -35
- package/lib/store/stub.js.map +1 -1
- package/lib/sync-accumulator.js +54 -66
- package/lib/sync-accumulator.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +905 -998
- package/lib/sync.js.map +1 -1
- package/lib/testing.js +63 -105
- package/lib/testing.js.map +1 -1
- package/lib/thread-utils.js +1 -4
- package/lib/thread-utils.js.map +1 -1
- package/lib/timeline-window.js +89 -102
- package/lib/timeline-window.js.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/utils/decryptAESSecretStorageItem.js +14 -25
- package/lib/utils/decryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/encryptAESSecretStorageItem.js +27 -38
- package/lib/utils/encryptAESSecretStorageItem.js.map +1 -1
- package/lib/utils/internal/deriveKeys.js +25 -32
- package/lib/utils/internal/deriveKeys.js.map +1 -1
- package/lib/utils/roomVersion.js +1 -1
- package/lib/utils/roomVersion.js.map +1 -1
- package/lib/utils.js +83 -135
- package/lib/utils.js.map +1 -1
- package/lib/version-support.js +3 -3
- package/lib/version-support.js.map +1 -1
- package/lib/webrtc/audioContext.js +5 -6
- package/lib/webrtc/audioContext.js.map +1 -1
- package/lib/webrtc/call.js +1081 -1250
- package/lib/webrtc/call.js.map +1 -1
- package/lib/webrtc/callEventHandler.js +202 -214
- package/lib/webrtc/callEventHandler.js.map +1 -1
- package/lib/webrtc/callEventTypes.js +2 -2
- package/lib/webrtc/callEventTypes.js.map +1 -1
- package/lib/webrtc/callFeed.js +18 -20
- package/lib/webrtc/callFeed.js.map +1 -1
- package/lib/webrtc/groupCall.js +513 -602
- package/lib/webrtc/groupCall.js.map +1 -1
- package/lib/webrtc/groupCallEventHandler.js +59 -62
- package/lib/webrtc/groupCallEventHandler.js.map +1 -1
- package/lib/webrtc/mediaHandler.js +198 -232
- package/lib/webrtc/mediaHandler.js.map +1 -1
- package/lib/webrtc/stats/callFeedStatsReporter.js +16 -20
- package/lib/webrtc/stats/callFeedStatsReporter.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportGatherer.js +67 -75
- package/lib/webrtc/stats/callStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/callStatsReportSummary.js +3 -1
- package/lib/webrtc/stats/connectionStats.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsBuilder.js +2 -2
- package/lib/webrtc/stats/connectionStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/connectionStatsReportBuilder.js +20 -24
- package/lib/webrtc/stats/connectionStatsReportBuilder.js.map +1 -1
- package/lib/webrtc/stats/groupCallStats.js +6 -8
- package/lib/webrtc/stats/groupCallStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaSsrcHandler.js +7 -8
- package/lib/webrtc/stats/media/mediaSsrcHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackHandler.js +7 -9
- package/lib/webrtc/stats/media/mediaTrackHandler.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStats.js +3 -3
- package/lib/webrtc/stats/media/mediaTrackStats.js.map +1 -1
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js +7 -7
- package/lib/webrtc/stats/media/mediaTrackStatsHandler.js.map +1 -1
- package/lib/webrtc/stats/statsReport.js +1 -1
- package/lib/webrtc/stats/statsReport.js.map +1 -1
- package/lib/webrtc/stats/statsReportEmitter.js.map +1 -1
- package/lib/webrtc/stats/summaryStatsReportGatherer.js +14 -14
- package/lib/webrtc/stats/summaryStatsReportGatherer.js.map +1 -1
- package/lib/webrtc/stats/trackStatsBuilder.js +32 -34
- package/lib/webrtc/stats/trackStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/transportStats.js +3 -1
- package/lib/webrtc/stats/transportStatsBuilder.js +9 -9
- package/lib/webrtc/stats/transportStatsBuilder.js.map +1 -1
- package/lib/webrtc/stats/valueFormatter.js +1 -1
- package/lib/webrtc/stats/valueFormatter.js.map +1 -1
- package/package.json +18 -33
- package/src/@types/global.d.ts +2 -2
- package/src/ToDeviceMessageQueue.ts +2 -2
- package/src/browser-index.ts +4 -4
- package/src/client.ts +15 -20
- package/src/crypto-api/index.ts +17 -6
- package/src/embedded.ts +4 -6
- package/src/filter-component.ts +1 -0
- package/src/http-api/utils.ts +1 -1
- package/src/interactive-auth.ts +11 -5
- package/src/matrixrtc/LivekitTransport.ts +1 -1
- package/src/matrixrtc/MatrixRTCSession.ts +1 -1
- package/src/models/MSC3089Branch.ts +1 -1
- package/src/models/room-sticky-events.ts +1 -0
- package/src/models/room.ts +9 -11
- package/src/receipt-accumulator.ts +2 -0
- package/src/rendezvous/index.ts +1 -1
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +2 -2
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +1 -1
- package/src/rust-crypto/index.ts +6 -6
- package/src/rust-crypto/rust-crypto.ts +31 -7
- package/src/rust-crypto/verification.ts +1 -1
- package/src/sliding-sync-sdk.ts +5 -7
- package/src/store/indexeddb-local-backend.ts +3 -3
- package/src/sync.ts +6 -8
package/src/client.ts
CHANGED
|
@@ -223,6 +223,7 @@ import { type CryptoBackend } from "./common-crypto/CryptoBackend.ts";
|
|
|
223
223
|
import { RUST_SDK_STORE_PREFIX } from "./rust-crypto/constants.ts";
|
|
224
224
|
import {
|
|
225
225
|
type CrossSigningKeyInfo,
|
|
226
|
+
type CrossSigningKeys,
|
|
226
227
|
type CryptoApi,
|
|
227
228
|
type CryptoCallbacks,
|
|
228
229
|
CryptoEvent,
|
|
@@ -570,14 +571,6 @@ export const UNSTABLE_MSC4354_STICKY_EVENTS = "org.matrix.msc4354";
|
|
|
570
571
|
export const UNSTABLE_MSC4133_EXTENDED_PROFILES = "uk.tcpip.msc4133";
|
|
571
572
|
export const STABLE_MSC4133_EXTENDED_PROFILES = "uk.tcpip.msc4133.stable";
|
|
572
573
|
|
|
573
|
-
enum CrossSigningKeyType {
|
|
574
|
-
MasterKey = "master_key",
|
|
575
|
-
SelfSigningKey = "self_signing_key",
|
|
576
|
-
UserSigningKey = "user_signing_key",
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
export type CrossSigningKeys = Record<CrossSigningKeyType, CrossSigningKeyInfo>;
|
|
580
|
-
|
|
581
574
|
export type SendToDeviceContentMap = Map<string, Map<string, Record<string, any>>>;
|
|
582
575
|
|
|
583
576
|
export interface ISignedKey {
|
|
@@ -588,6 +581,9 @@ export interface ISignedKey {
|
|
|
588
581
|
device_id: string;
|
|
589
582
|
}
|
|
590
583
|
|
|
584
|
+
// re-export for backwards compatibility
|
|
585
|
+
export { type CrossSigningKeys };
|
|
586
|
+
|
|
591
587
|
export type KeySignatures = Record<string, Record<string, CrossSigningKeyInfo | ISignedKey>>;
|
|
592
588
|
export interface IUploadKeySignaturesResponse {
|
|
593
589
|
failures: Record<
|
|
@@ -1490,10 +1486,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
1490
1486
|
// periodically poll for turn servers if we support voip
|
|
1491
1487
|
if (this.supportsVoip()) {
|
|
1492
1488
|
this.checkTurnServersIntervalID = setInterval(() => {
|
|
1493
|
-
this.checkTurnServers();
|
|
1489
|
+
void this.checkTurnServers();
|
|
1494
1490
|
}, TURN_CHECK_INTERVAL);
|
|
1495
|
-
|
|
1496
|
-
this.checkTurnServers();
|
|
1491
|
+
void this.checkTurnServers();
|
|
1497
1492
|
}
|
|
1498
1493
|
|
|
1499
1494
|
if (this.syncApi) {
|
|
@@ -1534,9 +1529,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
1534
1529
|
|
|
1535
1530
|
if (this.clientOpts.clientWellKnownPollPeriod !== undefined) {
|
|
1536
1531
|
this.clientWellKnownIntervalID = setInterval(() => {
|
|
1537
|
-
this.fetchClientWellKnown();
|
|
1532
|
+
void this.fetchClientWellKnown();
|
|
1538
1533
|
}, 1000 * this.clientOpts.clientWellKnownPollPeriod);
|
|
1539
|
-
this.fetchClientWellKnown();
|
|
1534
|
+
void this.fetchClientWellKnown();
|
|
1540
1535
|
}
|
|
1541
1536
|
|
|
1542
1537
|
this.toDeviceMessageQueue.start();
|
|
@@ -1922,7 +1917,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
1922
1917
|
*/
|
|
1923
1918
|
public retryImmediately(): boolean {
|
|
1924
1919
|
// don't await for this promise: we just want to kick it off
|
|
1925
|
-
this.toDeviceMessageQueue.sendQueue();
|
|
1920
|
+
void this.toDeviceMessageQueue.sendQueue();
|
|
1926
1921
|
return this.syncApi?.retryImmediately() ?? false;
|
|
1927
1922
|
}
|
|
1928
1923
|
|
|
@@ -2056,7 +2051,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
2056
2051
|
this.on(RoomMemberEvent.Membership, rustCrypto.onRoomMembership.bind(rustCrypto));
|
|
2057
2052
|
this.on(RoomStateEvent.Events, rustCrypto.onRoomStateEvent.bind(rustCrypto));
|
|
2058
2053
|
this.on(ClientEvent.Event, (event) => {
|
|
2059
|
-
rustCrypto.onLiveEventFromSync(event);
|
|
2054
|
+
void rustCrypto.onLiveEventFromSync(event);
|
|
2060
2055
|
});
|
|
2061
2056
|
|
|
2062
2057
|
// re-emit the events emitted by the crypto impl
|
|
@@ -2514,7 +2509,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
2514
2509
|
*/
|
|
2515
2510
|
public resendEvent(event: MatrixEvent, room: Room): Promise<ISendEventResponse> {
|
|
2516
2511
|
// also kick the to-device queue to retry
|
|
2517
|
-
this.toDeviceMessageQueue.sendQueue();
|
|
2512
|
+
void this.toDeviceMessageQueue.sendQueue();
|
|
2518
2513
|
|
|
2519
2514
|
this.updatePendingEventStatus(room, event, EventStatus.SENDING);
|
|
2520
2515
|
return this.encryptAndSendEvent(room, event);
|
|
@@ -5918,7 +5913,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
5918
5913
|
if (this.isInitialSyncComplete()) {
|
|
5919
5914
|
if (supportsMatrixCall()) {
|
|
5920
5915
|
this.callEventHandler!.start();
|
|
5921
|
-
this.groupCallEventHandler!.start();
|
|
5916
|
+
void this.groupCallEventHandler!.start();
|
|
5922
5917
|
}
|
|
5923
5918
|
|
|
5924
5919
|
this.off(ClientEvent.Sync, this.startCallEventHandler);
|
|
@@ -6432,7 +6427,7 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
6432
6427
|
}
|
|
6433
6428
|
|
|
6434
6429
|
if (event.shouldAttemptDecryption() && this.getCrypto()) {
|
|
6435
|
-
event.attemptDecryption(this.cryptoBackend!, options);
|
|
6430
|
+
void event.attemptDecryption(this.cryptoBackend!, options);
|
|
6436
6431
|
}
|
|
6437
6432
|
|
|
6438
6433
|
if (event.isBeingDecrypted()) {
|
|
@@ -8836,8 +8831,8 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa
|
|
|
8836
8831
|
if (!events?.length) return;
|
|
8837
8832
|
if (!room) return;
|
|
8838
8833
|
|
|
8839
|
-
room.currentState.processBeaconEvents(events, this);
|
|
8840
|
-
room.processPollEvents(events);
|
|
8834
|
+
void room.currentState.processBeaconEvents(events, this);
|
|
8835
|
+
void room.processPollEvents(events);
|
|
8841
8836
|
}
|
|
8842
8837
|
|
|
8843
8838
|
/**
|
package/src/crypto-api/index.ts
CHANGED
|
@@ -74,8 +74,6 @@ export interface StartDehydrationOpts {
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Public interface to the cryptography parts of the js-sdk
|
|
77
|
-
*
|
|
78
|
-
* @remarks Currently, this is a work-in-progress. In time, more methods will be added here.
|
|
79
77
|
*/
|
|
80
78
|
export interface CryptoApi {
|
|
81
79
|
/**
|
|
@@ -267,10 +265,18 @@ export interface CryptoApi {
|
|
|
267
265
|
*
|
|
268
266
|
* This is useful if the user was previously verified but is not anymore
|
|
269
267
|
* ({@link UserVerificationStatus.wasCrossSigningVerified}) and it is not possible to verify him again now.
|
|
270
|
-
*
|
|
271
268
|
*/
|
|
272
269
|
withdrawVerificationRequirement(userId: string): Promise<void>;
|
|
273
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Get the given user's public cross-signing keys, if they have published any, and we have fetched them to
|
|
273
|
+
* our store.
|
|
274
|
+
*
|
|
275
|
+
* Normally this is only useful to applications as debug info, since the SDK handles keeping track of a
|
|
276
|
+
* user's identity, and whether their devices are verified.
|
|
277
|
+
*/
|
|
278
|
+
getUserCrossSigningKeys(userId: string): Promise<Partial<CrossSigningKeys> | null>;
|
|
279
|
+
|
|
274
280
|
/**
|
|
275
281
|
* Get the verification status of a given device.
|
|
276
282
|
*
|
|
@@ -1224,11 +1230,16 @@ export interface CreateSecretStorageOpts {
|
|
|
1224
1230
|
|
|
1225
1231
|
/** Types of cross-signing key */
|
|
1226
1232
|
export enum CrossSigningKey {
|
|
1227
|
-
Master = "
|
|
1228
|
-
SelfSigning = "
|
|
1229
|
-
UserSigning = "
|
|
1233
|
+
Master = "master_key",
|
|
1234
|
+
SelfSigning = "self_signing_key",
|
|
1235
|
+
UserSigning = "user_signing_key",
|
|
1230
1236
|
}
|
|
1231
1237
|
|
|
1238
|
+
/** All of a user's cross-signing keys.
|
|
1239
|
+
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3keysdevice_signingupload
|
|
1240
|
+
*/
|
|
1241
|
+
export type CrossSigningKeys = Record<CrossSigningKey, CrossSigningKeyInfo>;
|
|
1242
|
+
|
|
1232
1243
|
/**
|
|
1233
1244
|
* Information on one of the cross-signing keys.
|
|
1234
1245
|
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3keysdevice_signingupload
|
package/src/embedded.ts
CHANGED
|
@@ -527,19 +527,17 @@ export class RoomWidgetClient extends MatrixClient {
|
|
|
527
527
|
);
|
|
528
528
|
}
|
|
529
529
|
|
|
530
|
-
let updateDelayedEvent: (delayId: string) => Promise<unknown>;
|
|
531
530
|
switch (action) {
|
|
532
531
|
case UpdateDelayedEventAction.Cancel:
|
|
533
|
-
|
|
532
|
+
await this.widgetApi.cancelScheduledDelayedEvent(delayId).catch(timeoutToConnectionError);
|
|
534
533
|
break;
|
|
535
534
|
case UpdateDelayedEventAction.Restart:
|
|
536
|
-
|
|
535
|
+
await this.widgetApi.restartScheduledDelayedEvent(delayId).catch(timeoutToConnectionError);
|
|
537
536
|
break;
|
|
538
537
|
case UpdateDelayedEventAction.Send:
|
|
539
|
-
|
|
538
|
+
await this.widgetApi.sendScheduledDelayedEvent(delayId).catch(timeoutToConnectionError);
|
|
540
539
|
break;
|
|
541
540
|
}
|
|
542
|
-
await updateDelayedEvent.call(this.widgetApi, delayId).catch(timeoutToConnectionError);
|
|
543
541
|
return {};
|
|
544
542
|
}
|
|
545
543
|
|
|
@@ -682,7 +680,7 @@ export class RoomWidgetClient extends MatrixClient {
|
|
|
682
680
|
}
|
|
683
681
|
|
|
684
682
|
private async ack(ev: CustomEvent<IWidgetApiRequest>): Promise<void> {
|
|
685
|
-
|
|
683
|
+
this.widgetApi.transport.reply<IWidgetApiAcknowledgeResponseData>(ev.detail, {});
|
|
686
684
|
}
|
|
687
685
|
|
|
688
686
|
private updateTxId = async (event: MatrixEvent): Promise<void> => {
|
package/src/filter-component.ts
CHANGED
|
@@ -195,6 +195,7 @@ export class FilterComponent {
|
|
|
195
195
|
* @returns events which matched the filter component
|
|
196
196
|
*/
|
|
197
197
|
public filter(events: MatrixEvent[]): MatrixEvent[] {
|
|
198
|
+
// oxlint-disable-next-line typescript/unbound-method
|
|
198
199
|
return events.filter(this.check, this);
|
|
199
200
|
}
|
|
200
201
|
|
package/src/http-api/utils.ts
CHANGED
package/src/interactive-auth.ts
CHANGED
|
@@ -205,7 +205,7 @@ interface IOpts<T> {
|
|
|
205
205
|
* The busyChanged callback should be used instead of the background flag.
|
|
206
206
|
* Should return a promise which resolves to the successful response or rejects with a MatrixError.
|
|
207
207
|
*/
|
|
208
|
-
doRequest(auth: AuthDict | null, background: boolean): Promise<T>;
|
|
208
|
+
doRequest(this: void, auth: AuthDict | null, background: boolean): Promise<T>;
|
|
209
209
|
/**
|
|
210
210
|
* Called when the status of the UI auth changes,
|
|
211
211
|
* ie. when the state of an auth stage changes of when the auth flow moves to a new stage.
|
|
@@ -219,7 +219,7 @@ interface IOpts<T> {
|
|
|
219
219
|
* m.login.email.identity:
|
|
220
220
|
* * emailSid: string, the sid of the active email auth session
|
|
221
221
|
*/
|
|
222
|
-
stateUpdated(nextStage: AuthType | string, status: IStageStatus): void;
|
|
222
|
+
stateUpdated(this: void, nextStage: AuthType | string, status: IStageStatus): void;
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* A function that takes the email address (string), clientSecret (string), attempt number (int) and
|
|
@@ -227,14 +227,20 @@ interface IOpts<T> {
|
|
|
227
227
|
* function.
|
|
228
228
|
* If the resulting promise rejects, the rejection will propagate through to the attemptAuth promise.
|
|
229
229
|
*/
|
|
230
|
-
requestEmailToken(
|
|
230
|
+
requestEmailToken(
|
|
231
|
+
this: void,
|
|
232
|
+
email: string,
|
|
233
|
+
secret: string,
|
|
234
|
+
attempt: number,
|
|
235
|
+
session: string,
|
|
236
|
+
): Promise<{ sid: string }>;
|
|
231
237
|
/**
|
|
232
238
|
* Called whenever the interactive auth logic becomes busy submitting information provided by the user or finishes.
|
|
233
239
|
* After this has been called with true the UI should indicate that a request is in progress
|
|
234
240
|
* until it is called again with false.
|
|
235
241
|
*/
|
|
236
|
-
busyChanged?(busy: boolean): void;
|
|
237
|
-
startAuthStage?(nextStage: string): Promise<void>; // LEGACY
|
|
242
|
+
busyChanged?(this: void, busy: boolean): void;
|
|
243
|
+
startAuthStage?(this: void, nextStage: string): Promise<void>; // LEGACY
|
|
238
244
|
}
|
|
239
245
|
|
|
240
246
|
/**
|
|
@@ -32,7 +32,7 @@ export const isLivekitTransport = (object: any): object is LivekitTransport =>
|
|
|
32
32
|
isLivekitTransportConfig(object) && "livekit_alias" in object;
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
|
-
* @deprecated
|
|
35
|
+
* @deprecated this is just needed for the old focus active / focus fields of a call membership.
|
|
36
36
|
* Not needed for new implementations.
|
|
37
37
|
*/
|
|
38
38
|
export interface LivekitFocusSelection extends Transport {
|
|
@@ -816,7 +816,7 @@ export class MatrixRTCSession extends TypedEventEmitter<
|
|
|
816
816
|
}
|
|
817
817
|
// This also needs to be done if `changed` = false
|
|
818
818
|
// A member might have updated their fingerprint (created_ts)
|
|
819
|
-
|
|
819
|
+
this.encryptionManager?.onMembershipsUpdate(oldMemberships);
|
|
820
820
|
|
|
821
821
|
this.setExpiryTimer();
|
|
822
822
|
};
|
|
@@ -198,7 +198,7 @@ export class MSC3089Branch {
|
|
|
198
198
|
additionalContent?: IContent,
|
|
199
199
|
): Promise<ISendEventResponse> {
|
|
200
200
|
const fileEventResponse = await this.directory.createFile(name, encryptedContents, info, {
|
|
201
|
-
...
|
|
201
|
+
...additionalContent,
|
|
202
202
|
"m.new_content": true,
|
|
203
203
|
"m.relates_to": {
|
|
204
204
|
rel_type: RelationType.Replace,
|
|
@@ -85,6 +85,7 @@ export class RoomStickyEventsStore extends TypedEventEmitter<RoomStickyEventsEve
|
|
|
85
85
|
/**
|
|
86
86
|
* Get all sticky events that are currently active.
|
|
87
87
|
* @returns An iterable set of events.
|
|
88
|
+
* @yields {@link StickyMatrixEvent}
|
|
88
89
|
*/
|
|
89
90
|
public *getStickyEvents(): Iterable<StickyMatrixEvent> {
|
|
90
91
|
yield* this.unkeyedStickyEvents;
|
package/src/models/room.ts
CHANGED
|
@@ -1352,11 +1352,11 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
1355
|
-
private onReceipt(event: MatrixEvent): void {
|
|
1355
|
+
private onReceipt = (event: MatrixEvent): void => {
|
|
1356
1356
|
if (this.hasEncryptionStateEvent()) {
|
|
1357
1357
|
this.clearNotificationsOnReceipt(event);
|
|
1358
1358
|
}
|
|
1359
|
-
}
|
|
1359
|
+
};
|
|
1360
1360
|
|
|
1361
1361
|
private clearNotificationsOnReceipt(event: MatrixEvent): void {
|
|
1362
1362
|
// Like above, we have to listen for read receipts from ourselves in order to
|
|
@@ -1598,9 +1598,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|
|
1598
1598
|
const notification: NotificationCount = {
|
|
1599
1599
|
highlight: this.threadNotifications.get(threadId)?.highlight,
|
|
1600
1600
|
total: this.threadNotifications.get(threadId)?.total,
|
|
1601
|
-
|
|
1602
|
-
[type]: count,
|
|
1603
|
-
},
|
|
1601
|
+
[type]: count,
|
|
1604
1602
|
};
|
|
1605
1603
|
|
|
1606
1604
|
this.threadNotifications.set(threadId, notification);
|
|
@@ -2327,15 +2325,15 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|
|
2327
2325
|
}
|
|
2328
2326
|
}
|
|
2329
2327
|
|
|
2330
|
-
private onThreadUpdate(thread: Thread): void {
|
|
2328
|
+
private onThreadUpdate = (thread: Thread): void => {
|
|
2331
2329
|
this.updateThreadRootEvents(thread, false, false);
|
|
2332
|
-
}
|
|
2330
|
+
};
|
|
2333
2331
|
|
|
2334
|
-
private onThreadReply(thread: Thread): void {
|
|
2332
|
+
private onThreadReply = (thread: Thread): void => {
|
|
2335
2333
|
this.updateThreadRootEvents(thread, false, true);
|
|
2336
|
-
}
|
|
2334
|
+
};
|
|
2337
2335
|
|
|
2338
|
-
private onThreadDelete(thread: Thread): void {
|
|
2336
|
+
private onThreadDelete = (thread: Thread): void => {
|
|
2339
2337
|
this.threads.delete(thread.id);
|
|
2340
2338
|
|
|
2341
2339
|
const timeline = this.getTimelineForEvent(thread.id);
|
|
@@ -2348,7 +2346,7 @@ export class Room extends ReadReceipt<RoomEmittedEvents, RoomEventHandlerMap> {
|
|
|
2348
2346
|
for (const timelineSet of this.threadsTimelineSets) {
|
|
2349
2347
|
timelineSet.removeEvent(thread.id);
|
|
2350
2348
|
}
|
|
2351
|
-
}
|
|
2349
|
+
};
|
|
2352
2350
|
|
|
2353
2351
|
/**
|
|
2354
2352
|
* Forget the timelineSet for this room with the given filter
|
|
@@ -65,6 +65,7 @@ export class ReceiptAccumulator {
|
|
|
65
65
|
/**
|
|
66
66
|
* @returns an iterator of pairs of [userId, AccumulatedReceipt] - all the
|
|
67
67
|
* most recently-received unthreaded receipts for each user.
|
|
68
|
+
* @yields pairs of [userId, AccumulatedReceipt]
|
|
68
69
|
*/
|
|
69
70
|
private allUnthreaded(): IterableIterator<[string, AccumulatedReceipt]> {
|
|
70
71
|
return this.unthreadedReadReceipts.entries();
|
|
@@ -74,6 +75,7 @@ export class ReceiptAccumulator {
|
|
|
74
75
|
* @returns an iterator of pairs of [userId, AccumulatedReceipt] - all the
|
|
75
76
|
* most recently-received threaded receipts for each user, in all
|
|
76
77
|
* threads.
|
|
78
|
+
* @yields pairs of [userId, AccumulatedReceipt]
|
|
77
79
|
*/
|
|
78
80
|
private *allThreaded(): IterableIterator<[string, AccumulatedReceipt]> {
|
|
79
81
|
for (const receiptsForThread of this.threadedReadReceipts.values()) {
|
package/src/rendezvous/index.ts
CHANGED
|
@@ -127,7 +127,7 @@ async function initGenerateQrFlow(
|
|
|
127
127
|
channel.onFailure = undefined;
|
|
128
128
|
flow.onFailure = undefined;
|
|
129
129
|
// Cancel the session
|
|
130
|
-
flow.cancel(MSC4108FailureReason.UserCancelled);
|
|
130
|
+
void flow.cancel(MSC4108FailureReason.UserCancelled);
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
await session.send(""); // open channel
|
|
@@ -160,7 +160,7 @@ export class MSC4108RendezvousSession {
|
|
|
160
160
|
this.expiresAt = new Date(expires);
|
|
161
161
|
this.expiresTimer = setTimeout(() => {
|
|
162
162
|
this.expiresTimer = undefined;
|
|
163
|
-
this.cancel(ClientRendezvousFailureReason.Expired);
|
|
163
|
+
void this.cancel(ClientRendezvousFailureReason.Expired);
|
|
164
164
|
}, this.expiresAt.getTime() - Date.now());
|
|
165
165
|
}
|
|
166
166
|
// MSC4108: we expect a JSON response with a rendezvous URL
|
|
@@ -175,7 +175,7 @@ export class MSC4108RendezvousSession {
|
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
177
|
* Receives data from the rendezvous channel.
|
|
178
|
-
* @
|
|
178
|
+
* @returns the returned promise won't resolve until new data is acquired or the channel is closed either by the server or the other party.
|
|
179
179
|
*/
|
|
180
180
|
public async receive(): Promise<string | undefined> {
|
|
181
181
|
if (!this.url) {
|
|
@@ -130,7 +130,7 @@ export class PerSessionKeyBackupDownloader {
|
|
|
130
130
|
/**
|
|
131
131
|
* Check if key download is successfully configured and active.
|
|
132
132
|
*
|
|
133
|
-
* @
|
|
133
|
+
* @returns `true` if key download is correctly configured and active; otherwise `false`.
|
|
134
134
|
*/
|
|
135
135
|
public isKeyBackupDownloadConfigured(): boolean {
|
|
136
136
|
return this.configuration !== null;
|
package/src/rust-crypto/index.ts
CHANGED
|
@@ -185,23 +185,23 @@ async function initOlmMachine(
|
|
|
185
185
|
enableEncryptedStateEvents,
|
|
186
186
|
);
|
|
187
187
|
|
|
188
|
-
|
|
188
|
+
olmMachine.registerRoomKeyUpdatedCallback((sessions: RustSdkCryptoJs.RoomKeyInfo[]) =>
|
|
189
189
|
rustCrypto.onRoomKeysUpdated(sessions),
|
|
190
190
|
);
|
|
191
|
-
|
|
191
|
+
olmMachine.registerRoomKeysWithheldCallback((withheld: RustSdkCryptoJs.RoomKeyWithheldInfo[]) =>
|
|
192
192
|
rustCrypto.onRoomKeysWithheld(withheld),
|
|
193
193
|
);
|
|
194
|
-
|
|
194
|
+
olmMachine.registerUserIdentityUpdatedCallback((userId: RustSdkCryptoJs.UserId) =>
|
|
195
195
|
rustCrypto.onUserIdentityUpdated(userId),
|
|
196
196
|
);
|
|
197
|
-
|
|
197
|
+
olmMachine.registerDevicesUpdatedCallback((userIds: string[]) => rustCrypto.onDevicesUpdated(userIds));
|
|
198
198
|
|
|
199
199
|
// Check if there are any key backup secrets pending processing. There may be multiple secrets to process if several devices have gossiped them.
|
|
200
200
|
// The `registerReceiveSecretCallback` function will only be triggered for new secrets. If the client is restarted before processing them, the secrets will need to be manually handled.
|
|
201
|
-
rustCrypto.checkSecrets("m.megolm_backup.v1");
|
|
201
|
+
void rustCrypto.checkSecrets("m.megolm_backup.v1");
|
|
202
202
|
|
|
203
203
|
// Register a callback to be notified when a new secret is received, as for now only the key backup secret is supported (the cross signing secrets are handled automatically by the OlmMachine)
|
|
204
|
-
|
|
204
|
+
olmMachine.registerReceiveSecretCallback((name: string, _value: string) =>
|
|
205
205
|
// Instead of directly checking the secret value, we poll the inbox to get all values for that secret type.
|
|
206
206
|
// Once we have all the values, we can safely clear the secret inbox.
|
|
207
207
|
rustCrypto.checkSecrets(name),
|
|
@@ -42,6 +42,7 @@ import {
|
|
|
42
42
|
type BackupTrustInfo,
|
|
43
43
|
type BootstrapCrossSigningOpts,
|
|
44
44
|
type CreateSecretStorageOpts,
|
|
45
|
+
type CrossSigningKeys,
|
|
45
46
|
CrossSigningKey,
|
|
46
47
|
type CrossSigningKeyInfo,
|
|
47
48
|
type CrossSigningStatus,
|
|
@@ -771,6 +772,29 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
771
772
|
await userIdentity.withdrawVerification();
|
|
772
773
|
}
|
|
773
774
|
|
|
775
|
+
/**
|
|
776
|
+
* Implementation of {@link CryptoApi#getUserCrossSigningKeys}.
|
|
777
|
+
*/
|
|
778
|
+
public async getUserCrossSigningKeys(userId: string): Promise<Partial<CrossSigningKeys> | null> {
|
|
779
|
+
const userIdentity = await this.getOlmMachineOrThrow().getIdentity(new RustSdkCryptoJs.UserId(userId));
|
|
780
|
+
|
|
781
|
+
if (!userIdentity) {
|
|
782
|
+
return null;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const result: Partial<CrossSigningKeys> = {
|
|
786
|
+
master_key: JSON.parse(userIdentity.masterKey),
|
|
787
|
+
self_signing_key: JSON.parse(userIdentity.selfSigningKey),
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
// The USK is only visible for our own identity
|
|
791
|
+
if ("userSigningKey" in userIdentity) {
|
|
792
|
+
result.user_signing_key = JSON.parse(userIdentity.userSigningKey);
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return result;
|
|
796
|
+
}
|
|
797
|
+
|
|
774
798
|
/**
|
|
775
799
|
* Implementation of {@link CryptoApi#isCrossSigningReady}
|
|
776
800
|
*/
|
|
@@ -1147,7 +1171,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
1147
1171
|
verificationMethodIdentifierToMethod(method),
|
|
1148
1172
|
);
|
|
1149
1173
|
// Get the request content to send to the DM room
|
|
1150
|
-
const verCont: string =
|
|
1174
|
+
const verCont: string = userIdentity.verificationRequestContent(methods);
|
|
1151
1175
|
|
|
1152
1176
|
// TODO: due to https://github.com/matrix-org/matrix-rust-sdk/issues/5643, we need to fix up the verification request content to include `msgtype`.
|
|
1153
1177
|
const verContObj = JSON.parse(verCont);
|
|
@@ -1158,7 +1182,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
1158
1182
|
const eventId = await this.sendVerificationRequestContent(roomId, verificationEventContent);
|
|
1159
1183
|
|
|
1160
1184
|
// Get a verification request
|
|
1161
|
-
const request: RustSdkCryptoJs.VerificationRequest =
|
|
1185
|
+
const request: RustSdkCryptoJs.VerificationRequest = userIdentity.requestVerification(
|
|
1162
1186
|
new RustSdkCryptoJs.RoomId(roomId),
|
|
1163
1187
|
new RustSdkCryptoJs.EventId(eventId),
|
|
1164
1188
|
methods,
|
|
@@ -1385,7 +1409,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
1385
1409
|
}
|
|
1386
1410
|
|
|
1387
1411
|
// we can check and start async
|
|
1388
|
-
this.checkKeyBackupAndEnable();
|
|
1412
|
+
void this.checkKeyBackupAndEnable();
|
|
1389
1413
|
}
|
|
1390
1414
|
|
|
1391
1415
|
/**
|
|
@@ -1572,7 +1596,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
1572
1596
|
|
|
1573
1597
|
// Delete the dehydrated device, since any existing one will be signed
|
|
1574
1598
|
// by the wrong cross-signing key
|
|
1575
|
-
this.dehydratedDeviceManager.delete();
|
|
1599
|
+
void this.dehydratedDeviceManager.delete();
|
|
1576
1600
|
|
|
1577
1601
|
// Disable backup, and delete all the backups from the server
|
|
1578
1602
|
await this.backupManager.deleteAllKeyBackupVersions();
|
|
@@ -1992,7 +2016,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
1992
2016
|
event.getContent().membership !== KnownMembership.Join
|
|
1993
2017
|
) {
|
|
1994
2018
|
this.logger.info(`Rotating session for room ${event.getRoomId()} due to member leaving the room`);
|
|
1995
|
-
this.forceDiscardSession(event.getRoomId()!);
|
|
2019
|
+
void this.forceDiscardSession(event.getRoomId()!);
|
|
1996
2020
|
}
|
|
1997
2021
|
}
|
|
1998
2022
|
|
|
@@ -2008,7 +2032,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
2008
2032
|
for (const key of keys) {
|
|
2009
2033
|
this.onRoomKeyUpdated(key);
|
|
2010
2034
|
}
|
|
2011
|
-
this.backupManager.maybeUploadKey();
|
|
2035
|
+
void this.backupManager.maybeUploadKey();
|
|
2012
2036
|
}
|
|
2013
2037
|
|
|
2014
2038
|
private onRoomKeyUpdated(key: RustSdkCryptoJs.RoomKeyInfo): void {
|
|
@@ -2179,7 +2203,7 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
|
|
2179
2203
|
|
|
2180
2204
|
clearTimeout(timeoutId);
|
|
2181
2205
|
event.off(MatrixEventEvent.Decrypted, onDecrypted);
|
|
2182
|
-
processEvent(decryptedEvent);
|
|
2206
|
+
void processEvent(decryptedEvent);
|
|
2183
2207
|
};
|
|
2184
2208
|
|
|
2185
2209
|
event.on(MatrixEventEvent.Decrypted, onDecrypted);
|
|
@@ -728,7 +728,7 @@ export class RustSASVerifier extends BaseRustVerifer<RustSdkCryptoJs.Sas> implem
|
|
|
728
728
|
mismatch: (): void => {
|
|
729
729
|
const request = this.inner.cancelWithCode("m.mismatched_sas");
|
|
730
730
|
if (request) {
|
|
731
|
-
this.outgoingRequestProcessor.makeOutgoingRequest(request);
|
|
731
|
+
void this.outgoingRequestProcessor.makeOutgoingRequest(request);
|
|
732
732
|
}
|
|
733
733
|
},
|
|
734
734
|
cancel: (): void => {
|
package/src/sliding-sync-sdk.ts
CHANGED
|
@@ -156,13 +156,11 @@ class ExtensionToDevice implements Extension<ExtensionToDeviceRequest, Extension
|
|
|
156
156
|
if (this.cryptoCallbacks) {
|
|
157
157
|
receivedToDeviceMessages = await this.cryptoCallbacks.preprocessToDeviceMessages(events);
|
|
158
158
|
} else {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}),
|
|
165
|
-
);
|
|
159
|
+
// Crypto is not enabled, so we just return the events.
|
|
160
|
+
receivedToDeviceMessages = events.map((rawEvent) => ({
|
|
161
|
+
message: rawEvent,
|
|
162
|
+
encryptionInfo: null,
|
|
163
|
+
}));
|
|
166
164
|
}
|
|
167
165
|
processToDeviceMessages(receivedToDeviceMessages, this.client);
|
|
168
166
|
|
|
@@ -323,10 +323,10 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend {
|
|
|
323
323
|
const roomRange = IDBKeyRange.only(roomId);
|
|
324
324
|
|
|
325
325
|
const minStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, "next")).then(
|
|
326
|
-
(cursor) => (<IDBValidKey[]>cursor?.primaryKey)[1],
|
|
326
|
+
(cursor) => (<IDBValidKey[]>cursor?.primaryKey)?.[1],
|
|
327
327
|
);
|
|
328
328
|
const maxStateKeyProm = reqAsCursorPromise(roomIndex.openKeyCursor(roomRange, "prev")).then(
|
|
329
|
-
(cursor) => (<IDBValidKey[]>cursor?.primaryKey)[1],
|
|
329
|
+
(cursor) => (<IDBValidKey[]>cursor?.primaryKey)?.[1],
|
|
330
330
|
);
|
|
331
331
|
const [minStateKey, maxStateKey] = await Promise.all([minStateKeyProm, maxStateKeyProm]);
|
|
332
332
|
|
|
@@ -637,7 +637,7 @@ export class LocalIndexedDBStoreBackend implements IIndexedDBBackend {
|
|
|
637
637
|
try {
|
|
638
638
|
this.syncAccumulator.removeEventsFromRoom(roomId, eventIds);
|
|
639
639
|
const syncData = this.syncAccumulator.getJSON(true);
|
|
640
|
-
await
|
|
640
|
+
await this.persistSyncData(syncData.nextBatch, syncData.roomsData);
|
|
641
641
|
} finally {
|
|
642
642
|
this.syncToDatabasePromise = undefined;
|
|
643
643
|
}
|
package/src/sync.ts
CHANGED
|
@@ -917,7 +917,7 @@ export class SyncApi {
|
|
|
917
917
|
// tell the crypto module to do its processing. It may block (to do a
|
|
918
918
|
// /keys/changes request).
|
|
919
919
|
if (this.syncOpts.cryptoCallbacks) {
|
|
920
|
-
|
|
920
|
+
this.syncOpts.cryptoCallbacks.onSyncCompleted(syncEventData);
|
|
921
921
|
}
|
|
922
922
|
|
|
923
923
|
// keep emitting SYNCING -> SYNCING for clients who want to do bulk updates
|
|
@@ -1195,13 +1195,11 @@ export class SyncApi {
|
|
|
1195
1195
|
receivedToDeviceMessages =
|
|
1196
1196
|
await this.syncOpts.cryptoCallbacks.preprocessToDeviceMessages(toDeviceMessages);
|
|
1197
1197
|
} else {
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
}),
|
|
1204
|
-
);
|
|
1198
|
+
// Crypto is not enabled, so we just return the events.
|
|
1199
|
+
receivedToDeviceMessages = toDeviceMessages.map((rawEvent) => ({
|
|
1200
|
+
message: rawEvent,
|
|
1201
|
+
encryptionInfo: null,
|
|
1202
|
+
}));
|
|
1205
1203
|
}
|
|
1206
1204
|
|
|
1207
1205
|
processToDeviceMessages(receivedToDeviceMessages, client);
|