Skip to content

chore(ui): Extract TimelineBuilder tasks into their own functions #4796

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

Merged
merged 7 commits into from
Mar 14, 2025

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Mar 12, 2025

Extracted from #4794.

This patch rewrites the TimelineBuilder::build() method by extracting all the spawned task code block into their own function. The resulting code is simpler to read, and we can reference each task by its function name. Moreover, each task is isolated, it's a bit easier to reason about.

@Hywan Hywan requested a review from stefanceriu March 12, 2025 18:27
@Hywan Hywan requested a review from a team as a code owner March 12, 2025 18:27
@Hywan Hywan removed the request for review from a team March 12, 2025 18:27
@Hywan Hywan force-pushed the chore-ui-timeline-builder-tasks branch from 4a72319 to 3780e44 Compare March 12, 2025 18:30
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 72.17391% with 32 lines in your changes missing coverage. Please review.

Project coverage is 86.34%. Comparing base (294fd79) to head (68db84d).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/timeline/builder.rs 72.17% 32 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4796      +/-   ##
==========================================
- Coverage   86.39%   86.34%   -0.05%     
==========================================
  Files         291      291              
  Lines       34365    34383      +18     
==========================================
- Hits        29690    29689       -1     
- Misses       4675     4694      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Lovely! 👨‍🍳 👌

Hywan added 7 commits March 14, 2025 10:33
This patch moves the task responsibles to handle the
`RoomEventCacheUpdate`s into its own function.

The goal is to get simpler code.
…ion.

This patch moves the task responsibles to handle the pinned event IDs
stream into its own function.

The goal is to get simpler code.
This patch moves the task responsibles to handle the
`RoomSendQueueUpdate`s into its own function.

The goal is to get simpler code.
…ion.

This patch moves the task responsibles to handle the room keys from
backups into its own function.

The goal is to get simpler code.
This patch moves the task responsibles to handle the `BackupState`
updates into its own function.

The goal is to get simpler code.
This patch moves the task responsibles to handle the `RoomKeyInfo`
updates into its own function.

The goal is to get simpler code.
This patch moves an inline comment in its correct place. Code
was inserted between the comment and the part of the code it was
documenting.
@Hywan Hywan force-pushed the chore-ui-timeline-builder-tasks branch from 3780e44 to 68db84d Compare March 14, 2025 09:33
@Hywan Hywan enabled auto-merge (rebase) March 14, 2025 09:40
@Hywan Hywan merged commit 5a22944 into matrix-org:main Mar 14, 2025
43 checks passed
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