1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00
Commit Graph

1904 Commits

Author SHA1 Message Date
Šimon Brandner
7f5d7091de Fix typos in src/webrtc/ (#3065) 2023-01-13 19:56:55 +01:00
David Baker
96f673ae92 Merge branch 'develop' into dbkr/olm_savesession_undecryptable_todevice_debug 2023-01-13 18:36:22 +00:00
David Baker
79faee7a67 Add emit so tests don't throw 2023-01-13 18:32:21 +00:00
Travis Ralston
bc78784688 Extract v1 extensible events polls types out of the events-sdk (#3062)
* Extract v1 extensible events polls out of events-sdk

* Appease tsdoc?

* Appease naming standards

* Bring the tests over too
2023-01-13 10:02:27 -07:00
Richard van der Hoff
eb058edb1b Fix spurious "Decryption key withheld" messages (#3061)
When we receive an `m.unavailable` notification, do not show it as "Decryption
key withheld".
2023-01-13 13:17:48 +00:00
Richard van der Hoff
4847d78b42 Improvements to megolm integration tests (#3060)
The megolm tests were making a few assumptions which they really shouldn't; in
particular:

 * They were creating mock events with event_ids not starting `$`, and lacking
   `sender`, `origin_server_ts` and `unsigned` properties

 * They were not including the (now) required `keys.ed25519` property inside
   the ciphertext of an olm message.

These work ok currently, but they aren't really correct, and they cause
problems when testing the new rust implementation.
2023-01-13 13:14:44 +00:00
Richard van der Hoff
d23c3cb8b2 Improve logging in legacy megolm code (#3043)
* Use a PrefixedLogger throughout `megolm.ts`

Rather than manually adding `in ${this.roomId}` to each log line, use a
PrefixedLogger to achieve the same effect more consistently.

* Clean up logging in megolm.ts

Where we log a list of devices, we don't need the whole deviceinfo, just the
device id. All that noise makes it very hard to read the logs.

* Log users that we find in the room when encrypting

* Reduce log verbosity on decryption retries
2023-01-12 11:49:32 +00:00
Germain
8e29f8ead0 Improve hasUserReadEvent and getUserReadUpTo realibility with threads (#3031)
Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2023-01-11 09:53:27 +00:00
Travis Ralston
185ded4ebc Remove extensible events v1 field population on legacy events (#3040)
* Remove extensible events v1 field population on legacy events

With extensible events v2, affected events are now gated by a room version, so we don't need this code anymore. 

The proposal has generally moved away from mixing m.room.message with extensible fields as well.

* Run prettier

* Remove unstable identifier from tests too

* Run prettier again
2023-01-10 09:19:55 -07:00
Andy Balaam
c6090325b3 Update id string to reflect spec 2023-01-10 13:29:06 +00:00
Andy Balaam
7de4164444 Factor out a (public) function to find a room's predecessor 2023-01-10 10:16:22 +00:00
Andy Balaam
e2ce379b56 Merge pull request #3038 from andybalaam/andybalaam/tests-for-getVisibleRooms
Tests for getVisibleRooms
2023-01-10 10:07:53 +00:00
Andy Balaam
424212cd65 Merge pull request #2915 from matrix-org/madlittlemods/stablize-msc3030-timestamp-to-event
Prefer stable `/timestamp_to_event` endpoint first - MSC3030
2023-01-09 17:01:10 +00:00
Andy Balaam
8a4c95ee72 Tests for getVisibleRooms 2023-01-09 12:17:53 +00:00
Šimon Brandner
fdb80ad259 Remove video track when muting video (#3028) 2023-01-06 12:09:01 -05:00
Andy Balaam
981acf0044 Rename test to fit renamed function.
Co-authored-by: Eric Eastwood <erice@element.io>
2023-01-06 16:38:02 +00:00
Andy Balaam
f00f70bfb8 Merge branch 'develop' into madlittlemods/stablize-msc3030-timestamp-to-event 2023-01-06 15:38:08 +00:00
Andy Balaam
12cc7be31c Test 400, 429 and 502 responses 2023-01-06 15:33:48 +00:00
Andy Balaam
628bcbf33a Fall back to the unstable endpoint if we receive a 405 status 2023-01-06 15:22:58 +00:00
Andy Balaam
c4ca0b2e07 Refactor timestampToEvent tests 2023-01-06 15:13:44 +00:00
Andy Balaam
d7442147b9 Rename convertQueryDictToMap 2023-01-06 14:21:35 +00:00
Andy Balaam
b1566ee540 Switch to a Map for convertQueryDictToStringRecord 2023-01-06 14:20:24 +00:00
Andy Balaam
ca98d9ff11 Tests for convertQueryDictToStringRecord 2023-01-06 14:20:24 +00:00
Germain
896f6227a0 Fix threaded cache receipt when event holds multiple receipts (#3026) 2023-01-06 10:27:35 +00:00
Kerry
bb23df9423 Add alt event type matching in Relations model (#3018)
* allow alt event types in relations model

* remove unneccesary checks on remove relation

* comment

* assert on event emitted
2023-01-05 20:00:12 +00:00
Richard van der Hoff
d02559cf3c Make error handling in decryptionLoop more generic (#3024)
Not everything is a `DecryptionError`, and there's no real reason that we
should only do retries for `DecryptionError`s
2023-01-05 15:02:19 +00:00
Richard van der Hoff
ec6272aa3d Fix outgoing messages for rust-crypto (#3025)
It turns out that MatrixClient uses a `FetchHttpApi` instance with
`opts.onlyData = true`, so it was returning the json-parsed response rather
than the raw response. Change the way we call `authedRequest` so that we get
the raw body back.
2023-01-05 15:00:37 +00:00
Michael Weimann
695b773f8b Fix false key requests after verifying new device (#3029) 2023-01-05 15:27:09 +01:00
Richard van der Hoff
030abe1563 Pass to-device messages into rust crypto-sdk (#3021)
We need a separate API, because `ClientEvent.ToDeviceEvent` is only emitted for
successfully decrypted to-device events
2023-01-05 09:54:56 +00:00
Richard van der Hoff
9ac7165e99 Handle outgoing requests from rust crypto SDK (#3019)
The rust matrix-sdk-crypto has an `outgoingRequests()` method which we need to poll, and make the requested requests.
2023-01-04 12:17:42 +00:00
Hubert Chathi
6168cedf32 Avoid triggering decryption errors when decrypting redacted events (#3004) 2023-01-03 11:06:54 -05:00
Richard van der Hoff
7c34deecb6 Pass CryptoBackend into SyncApi (#3010)
I need to start calling back into the new rust crypto implementation from the /sync loops, so I need to pass it into SyncApi. To reduce the coupling, I've defined a new interface specifying the methods which exist for that purpose. Currently it's only onSyncCompleted.
2023-01-03 15:37:51 +00:00
Richard van der Hoff
9b372d23ca Factor SyncApi options out of IStoredClientOptions (#3009)
There are a couple of callback interfaces which are currently stuffed into
`IStoredClientOpts` to make it easier to pass them into the `SyncApi`
constructor.

Before we add more fields to this, let's separate it out to a separate object.
2023-01-03 13:38:21 +00:00
Travis Ralston
7d37bb1edb Remove usage of v1 Identity Server API (#3003)
* Remove usage of v1 Identity Server API

It's been deprecated for over a year at this point - everyone should be able to support v2.

* Missed one.
2023-01-03 00:59:12 -07:00
Richard van der Hoff
ce776b9989 Break coupling between Room and Crypto.trackRoomDevices (#2998)
`Room` and `Crypto` currently have some tight coupling in the form of a call to
`trackRoomDevices` when out-of-band members are loaded. We can improve this by
instead having Crypto listen out for a `RoomSateEvent.Update` notification.
2022-12-23 11:03:14 +00:00
Germain
aead401005 Apply edits discovered from sync after thread is initialised (#3002) 2022-12-22 08:54:55 +00:00
kegsay
61e2606bc4 Merge pull request #2991 from S7evinK/s7evink/slidingsync-unsub
sliding sync: Fix issue where no unsubs are sent when switching rooms
2022-12-20 17:57:19 +01:00
Richard van der Hoff
45f6c5b079 Add exportRoomKeys to CryptoBackend (#2970)
Element-web calls `exportRoomKeys` on logout, so we need a stub implementation
to get it EW working with the rust crypto sdk.
2022-12-20 11:11:00 +00:00
Michael Weimann
b83c372848 Implement MSC3912: Relation-based redactions (#2954) 2022-12-20 09:22:26 +01:00
Šimon Brandner
6d58a54039 Don't use RoomMember as a calls a key on GroupCall (#2993) 2022-12-19 14:53:08 +01:00
Janne Mareike Koschinski
4f86eee250 Threads are missing from the timeline (#2996) 2022-12-19 10:32:37 +00:00
Till Faelligen
8af0ff111b Add tests for custom subscriptions 2022-12-16 13:30:40 +01:00
Eric Eastwood
4683fbe848 Merge branch 'develop' into madlittlemods/stablize-msc3030-timestamp-to-event
Conflicts:
	spec/unit/matrix-client.spec.ts
2022-12-16 00:56:06 -06:00
Anderas
447319737a Merge pull request #2920 from Anderas/resume-todevice-queue
Resume to-device message queue after resumed sync
2022-12-14 14:27:47 +00:00
Janne Mareike Koschinski
39e127b4e3 Write test to validate #2971 (#2972) 2022-12-14 13:01:52 +01:00
Richard van der Hoff
15ef8fabb7 Introduce a mechanism for using the rust-crypto-sdk (#2969)
This PR introduces MatrixClient.initRustCrypto, which is similar to initCrypto, except that it will use the Rust crypto SDK instead of the old libolm-based implementation.

This is very much not something you want to use in production code right now, because the integration with the rust sdk is extremely skeletal and almost everything crypto-related will raise an exception rather than doing anything useful.

It is, however, enough to demonstrate the loading of the wasmified rust sdk in element web, and a react sdk with light modifications can successfully log in and out.

Part of vector-im/element-web#21972.
2022-12-14 11:02:02 +00:00
Kerry
b2a10e6db3 Support MSC3391: Account data deletion (#2967)
* add deleteAccountData endpoint

* check server support and test

* test current state of memorystore

* interpret account data events with empty content as deleted

* add handling for (future) stable version of endpoint

* add getSafeUserId

* user getSafeUserId in deleteAccountData

* better jsdoc for throws documentation
2022-12-14 04:14:21 +00:00
Eric Eastwood
a0aa5074ed Fix prefix lint
See https://github.com/matrix-org/matrix-js-sdk/pull/2915#discussion_r1043951639
2022-12-13 16:37:47 -06:00
Eric Eastwood
70a033c2fd Prettier fixes 2022-12-13 16:26:14 -06:00
Eric Eastwood
fcf12b49e3 Merge branch 'develop' into madlittlemods/stablize-msc3030-timestamp-to-event
Conflicts:
	spec/unit/matrix-client.spec.ts
	src/client.ts
2022-12-13 16:18:33 -06:00