famedly / matrix-dart-sdk

Matrix SDK written in pure Dart.
GNU Affero General Public License v3.0
52 stars 30 forks source link

refactor: delete not sent events without eventupdate stream workaround #1788

Closed krille-chan closed 3 months ago

krille-chan commented 3 months ago

Fixes https://github.com/famedly/product-management/issues/1984

This fixes several problems. First sending a fake event through the onEventUpdate stream was not a good design and lead to problems if you expect a timeline event but then are unable to build the event from json. This now uses a new stream in the Client which is listened to in the timeline to delete an event which should be much more reliable. It also now throws an exception if deleting the event fails instead of returning true or false. A deprecation note is added. It also removes the behavior of silently delete a file event where the file is not stored. This is confusing for the user and the event should stay in the timeline until the user activly decides to try to send it again or delete the message.