Somehow, live events can be missing a timeline, even though that should not
happen... This restores @uhoreg's previous version where we test for this case.
Fixes https://github.com/vector-im/riot-web/issues/12120
Stacktrace:
```
TimelinePanel.js?b9ae:1139 Uncaught (in promise) TypeError: Cannot read property 'getBoundingClientRect' of null
at Object._getLastDisplayedEventIndex (TimelinePanel.js?b9ae:1139)
at Object.updateReadMarker (TimelinePanel.js?b9ae:751)
at Object._callee$ (TimelinePanel.js?b9ae:613)
at tryCatch (runtime.js?4422:45)
at Generator.invoke [as _invoke] (runtime.js?4422:271)
at Generator.prototype.<computed> [as next] (runtime.js?4422:97)
at asyncGeneratorStep (asyncToGenerator.js?56ef:3)
at _next (asyncToGenerator.js?56ef:25)
```
This is needed because `require()` means something different in webpack - it ends up importing the module as something we didn't expect (and is occasionally async)
We use `export default` begrudgingly here. Ideally we'd use just `export`, though this entire SDK expects things to be exported as a default. Instead of breaking everything, we'll sacrifice our export pattern for a smaller diff - a later commit can always do the default export -> regular export conversion.
This changes the `TimelinePanel` to track live events (that have committed to
the server and been remote echoed) as well as the full list of events (which
includes pending events).
The code paths that advance read receipt and read markers are then changed to
only use the live events so that these cannot advance into pending events.
Fixes https://github.com/vector-im/riot-web/issues/9952
This changes read receipt sending logic to allow it advance further into events
without tiles (such as edits or reactions) that may exist after the last
displayed event.
By allowing the read receipt to advance past such events, this also marks as
read any related notifications. For example, edits trigger notifications by
default since they are `m.room.message` events, and with this change, such edit
notifications can finally be marked read.
Part of https://github.com/vector-im/riot-web/issues/9745
Timeline sets may have a null room, such as with the notification timeline set.
Here we check that case when events are decrypted to avoid throw an error.
Fixes https://github.com/vector-im/riot-web/issues/9798
This fixes an error that crashed that notifications panel because it was trying
to read reactions, even though we currently don't aggregate them there. This
change is more explicit about exactly which views should try to show reactions.
Fixes https://github.com/vector-im/riot-web/issues/9713