Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FailedToParse timeline items #1224

Merged
merged 4 commits into from
Nov 24, 2022
Merged

Conversation

jplatte
Copy link
Collaborator

@jplatte jplatte commented Nov 21, 2022

When a timeline event comes in but we fail to deserialize it, previously we would just ignore it. Now, if we can still parse everything except the content, we add an EventTimelineItem with a new kind of content so the fact an event arrived isn't just silently discarded. The raw event and error can be reflected in the UI somehow. If something outside content fails to parse, that is either a bug in the server or in our code and we just log an error.

The first case can easily happen by having a buggy or malicious client, so I think it's important we preserve as much information as possible. In the latter case, just logging an error should be fine as it's much less likely (requires a bug in the server, ruma or the SDK).

@jplatte jplatte mentioned this pull request Nov 21, 2022
29 tasks
@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 74.41% // Head: 74.42% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (1b5b3b7) compared to base (43f0ba7).
Patch coverage: 73.73% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1224   +/-   ##
=======================================
  Coverage   74.41%   74.42%           
=======================================
  Files         112      113    +1     
  Lines       12869    12952   +83     
=======================================
+ Hits         9577     9639   +62     
- Misses       3292     3313   +21     
Impacted Files Coverage Δ
crates/matrix-sdk/src/lib.rs 100.00% <ø> (ø)
crates/matrix-sdk/src/room/timeline/event_item.rs 67.44% <ø> (ø)
crates/matrix-sdk/src/events.rs 70.21% <70.21%> (ø)
...ates/matrix-sdk/src/room/timeline/event_handler.rs 76.39% <76.92%> (+0.55%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jplatte jplatte force-pushed the jplatte/timeline-failed-to-parse branch from 367b025 to c58d3b0 Compare November 21, 2022 19:03
@jplatte jplatte requested a review from a team November 24, 2022 09:40
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jplatte jplatte force-pushed the jplatte/timeline-failed-to-parse branch from c58d3b0 to 1b5b3b7 Compare November 24, 2022 13:21
@jplatte jplatte enabled auto-merge (rebase) November 24, 2022 13:21
@jplatte jplatte merged commit c808a72 into main Nov 24, 2022
@jplatte jplatte deleted the jplatte/timeline-failed-to-parse branch November 24, 2022 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants