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

Get back to Recovering syncing when we haven't sync for a while #3995

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MatMaul
Copy link

@MatMaul MatMaul commented Sep 13, 2024

Fixes #3935.

Untested in the apps for now, but integration test is included and working.

Signed-off-by: Mathieu Velten mathieu@velten.xyz

@MatMaul MatMaul requested a review from a team as a code owner September 13, 2024 22:05
@MatMaul MatMaul requested review from jmartinesp and removed request for a team September 13, 2024 22:05
Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 88.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.24%. Comparing base (2a03de3) to head (e3d754b).

Files with missing lines Patch % Lines
crates/matrix-sdk-ui/src/sync_service.rs 50.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3995   +/-   ##
=======================================
  Coverage   84.23%   84.24%           
=======================================
  Files         266      266           
  Lines       28349    28364   +15     
=======================================
+ Hits        23881    23894   +13     
- Misses       4468     4470    +2     

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

@MatMaul MatMaul marked this pull request as draft September 13, 2024 23:36
@MatMaul MatMaul force-pushed the recovering branch 3 times, most recently from 4f08a1f to 0b79ccb Compare September 13, 2024 23:56
@MatMaul MatMaul marked this pull request as ready for review September 14, 2024 11:53
@bnjbvr bnjbvr requested review from Hywan and removed request for jmartinesp September 15, 2024 08:53
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.

Thank you for working on this. I appreciate.

I'm a bit annoyed by the introduction of the new testing feature: we are trying to remove then, and this PR adds a new one. I'm proposing a solution in my comment. Feel free to question my comment.

Running => Running,
Running { last_time } => {
// We haven't sync for a while so we should go back to recovering
if last_time.elapsed().as_secs() > 1800 {
Copy link
Member

Choose a reason for hiding this comment

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

Ideally, we would like to make this (1800) configurable because it can depend on the homeserver or how the user wants to use this API. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

If this is configurable, then we don't need mock_instant, nor the testing feature (we want to remove them, and this patch is adding them). If this is configurable then, we can simply set it to 1 sec, and have a sleep of 2 secs in the test. It can sound like a bit hacky but it's probably easier to maintain than having a new dependency and a new feature.

Copy link
Author

Choose a reason for hiding this comment

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

I am not sure it will be used much but it doesn't cost much to make it a parameter, and if it helps removing some maintenance burden in the tests it's probably worth it.

Yeah what you propose for the test is a bit hacky but it works ™️ , and it feels fine at the integration level.

On it.

Copy link
Author

Choose a reason for hiding this comment

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

Some docs are still missing, I'll clean up later on in the week, probably from Berlin ;)

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.

SSS: Enter "recovering" mode if the app has been offline for "a while"
2 participants