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

Calculate sync progress state #1643

Merged
merged 1 commit into from
Nov 24, 2022
Merged

Calculate sync progress state #1643

merged 1 commit into from
Nov 24, 2022

Conversation

Anderas
Copy link
Contributor

@Anderas Anderas commented Nov 23, 2022

Add MXSessionSyncProgress which tracks and calculates the state of the sync in order to determine whether we are waiting for the server response (and after how many attempts) or what is the overal percentage of data processed. For large accounts we may need to do 2-3 sync attempts with the server and data processing could take minutes, thus knowing what is the percentage completed can help users see how much longer they have to wait.

The design of sync progress is such that individual phases may choose to calculate progress however they like (e.g. handling of sync response only looks at rooms, not groups), and this single number is then incorporated in the overal sync progress, which depends on the number of phases. The design also makes it easy to add new phases in the future with ease if new areas need to report their progress.

This feature is currently under a feature flag and disabled by default.

Additionally fix some warnings with nullability and MatrixSDKCrypto warnings.

@Anderas Anderas requested review from a team and stefanceriu and removed request for a team November 23, 2022 10:44
@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Base: 16.03% // Head: 25.34% // Increases project coverage by +9.31% 🎉

Coverage data is based on head (dade4df) compared to base (5131019).
Patch coverage: 14.81% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1643      +/-   ##
===========================================
+ Coverage    16.03%   25.34%   +9.31%     
===========================================
  Files          583      585       +2     
  Lines        92561    92686     +125     
  Branches     39042    40203    +1161     
===========================================
+ Hits         14840    23493    +8653     
+ Misses       77234    68413    -8821     
- Partials       487      780     +293     
Impacted Files Coverage Δ
MatrixSDK/MXRestClient.m 27.11% <ø> (+24.66%) ⬆️
MatrixSDK/MXSessionSyncProgress.swift 0.00% <0.00%> (ø)
...atrixSDKTests/MXSessionSyncProgressUnitTests.swift 0.00% <0.00%> (ø)
MatrixSDK/MXSession.m 39.74% <36.50%> (+31.38%) ⬆️
MatrixSDK/MXSDKOptions.m 100.00% <100.00%> (ø)
MatrixSDK/Data/Filters/MXFilter.m 0.00% <0.00%> (-100.00%) ⬇️
MatrixSDKTests/MXErrorUnitTests.m 0.00% <0.00%> (-100.00%) ⬇️
MatrixSDKTests/MXToolsUnitTests.m 0.00% <0.00%> (-100.00%) ⬇️
MatrixSDKTests/MXFilterUnitTests.m 0.00% <0.00%> (-100.00%) ⬇️
MatrixSDKTests/MXPushRuleUnitTests.m 0.00% <0.00%> (-100.00%) ⬇️
... and 341 more

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.

Copy link
Contributor

@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.

Looks sweet! 👏

MatrixSDK/MXSession.m Show resolved Hide resolved
@Anderas Anderas merged commit 41d349d into develop Nov 24, 2022
@Anderas Anderas deleted the andy/sync_progress branch November 24, 2022 15:46
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.

None yet

2 participants