element-web/test/unit-tests
Robin d0cddc5b66
Feed events to widgets as they are decrypted (even if out of order) (#28376)
* Refactor feeding of events to widgets

This is a pure refactor with (hopefully) no behavior changes.

* Feed events to widgets as they are decrypted (even if out of order)

The code that feeds events to widgets tries to enforce that only events from the end of the timeline will be passed through. This is to prevent old, irrelevant events from being passed to widgets as the timeline is back-filled. However, since encrypted events need to be decrypted asynchronously, it's not possible to feed them to a widget in a strictly linear order without introducing some kind of blocking or unreliable delivery. This code has been dropping events when they're decrypted out of order, which we consider to be an undesirable behavior.

The solution provided here is that, to reflect the asynchronous nature of decryption, encrypted events that arrive at the end of the timeline will be fed to a widget whenever they finish decrypting, even if this means feeding them out of order. For now we're not aware of any widgets that care about knowing the exact order of events in the timeline, but if such a need reveals itself later, we can explore adding ordering information to this part of the widget API.

* Add braces to if
2024-11-08 14:35:47 +00:00
..
__snapshots__
accessibility
actions/handlers
async-components Update to React 18 (#24763) 2024-10-21 13:50:06 +00:00
audio
autocomplete
components Handle authenticated media when downloading from ImageView (#28379) 2024-11-07 11:43:33 +00:00
contexts Migrate to stylistic 2024-10-18 14:34:01 +01:00
customisations
dispatcher
editor Fix markdown escaping wrongly passing html through (#28363) 2024-11-04 11:31:44 +00:00
events
hooks Update to React 18 (#24763) 2024-10-21 13:50:06 +00:00
i18n
images
integrations
models Migrate to stylistic 2024-10-18 14:34:01 +01:00
modules Iterate 2024-10-15 16:22:11 +01:00
notifications
settings
stores Feed events to widgets as they are decrypted (even if out of order) (#28376) 2024-11-08 14:35:47 +00:00
toasts First batch: remove deprecated calls on `MatrixClient` (#28207) 2024-10-21 12:53:39 +01:00
utils Switch secondary React trees to the createRoot API (#28296) 2024-11-06 12:44:54 +00:00
vector Flatten Vector-override components (#28346) 2024-11-05 15:41:00 +00:00
voice-broadcast Migrate to stylistic 2024-10-18 14:34:01 +01:00
widgets
Avatar-test.ts
ContentMessages-test.ts Replace `MatrixClient.isRoomEncrypted` by `MatrixClient.CryptoApi.isEncryptionEnabledInRoom` in `ContentMessages.ts` (#28238) 2024-10-18 14:44:56 +00:00
DecryptionFailureTracker-test.ts Add PostHog codes for trust requirement failures (#28292) 2024-10-28 13:16:48 +00:00
DeviceListener-test.ts Remove boilerplate around dispatcher and settings watchers (#28338) 2024-11-01 15:15:04 +00:00
HtmlUtils-test.tsx
Image-test.ts
KeyBindingsManager-test.ts
LegacyCallHandler-test.ts
Lifecycle-test.ts Fix test 2024-10-18 13:38:25 +01:00
Markdown-test.ts
MatrixClientPeg-test.ts First batch: remove deprecated calls on `MatrixClient` (#28207) 2024-10-21 12:53:39 +01:00
MediaDeviceHandler-test.ts
Modal-test.ts
Notifier-test.ts
PosthogAnalytics-test.ts
PreferredRoomVersions-test.ts
README.md
Reply-test.ts
RoomNotifs-test.ts
Rooms-test.ts
ScalarAuthClient-test.ts
SdkConfig-test.ts
SecurityManager-test.ts
SlashCommands-test.tsx Remove references to `MatrixClient.crypto` (#28204) 2024-10-17 08:50:44 +01:00
SlidingSyncManager-test.ts
SupportedBrowser-test.ts Update browserslist (#28199) 2024-10-17 08:50:45 +01:00
Terms-test.tsx Migrate to stylistic 2024-10-18 14:34:01 +01:00
TestSdkContext.ts
TextForEvent-test.ts
TimezoneHandler-test.ts
Unread-test.ts
UserActivity-test.ts
WorkerManager-test.ts
createRoom-test.ts
email-test.ts
favicon-test.ts
languageHandler-test.tsx
linkify-matrix-test.ts
submit-rageshake-test.ts
theme-test.ts
useTopic-test.tsx

README.md

Any UTs for vector-web layer components or functionality should go here. This used to contain the UTs for notifications before they got moved to react-sdk.