-
Notifications
You must be signed in to change notification settings - Fork 490
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
Refactor UpdateManager
& Remove UpdateChecker
#13027
Refactor UpdateManager
& Remove UpdateChecker
#13027
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks very well.
WalletWasabi/Models/UpdateStatus.cs
Outdated
} | ||
|
||
public bool ClientUpToDate { get; } | ||
public bool ClientUpToDate { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this?
The whole class should be replaced by something like this:
public record UpdateStatus(bool ClientUpToDate, bool BackendCompatible, bool IsReadyToInstall, Version ClientVersion);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to write the same. It would be a great simplification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could simplify it yes, but to note:
When we instantiate UpdateStatus here, we aren't aware of ClientVersion (API request needed), ReadyToInstall (download needed) and ClientUpToDate (client version comparison needed).
I went with this because this way we can set these properties in UpdateManager when its needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something I don't get: Does this PR remove the ability for the client to find updates while it's running? It looks from the code that by removing UpdateChecker
we can now only catch updates on relaunch
Can we make UpdateManager
a PeriodicRunner
(with UpdateClientAsync
being ActionAsync
)?
@turbolay Your suggestion was my original idea, @lontivero suggested to go with this one-time-check solution. |
@lontivero Can you confirm that having the I personally dislike the idea of running the check for updates only at launch for a simple reason: It's better to never close Wasabi. It's less true without coinjoining but still. Also I see no harm in having a request per hour to GitHub. |
Yes, it is true, I suggested that. Well, I have no problem with checking from time to time. However I think this PR is good and I would like to merge it. @Szpoti would you like to check periodically again but i a different PR? |
fwiw, I think checking for releases once a day is enough. If we would check every hour, that's almost 1500 unnecessary checks during a two month release cycle. Distributing the new downloads across 24 hours is also a nice load balancing for the server, and in the case of a swift hotfix some users wouldn't download the initial version. |
@lontivero I can do that if you find it necessary. It can be a 24 hours cycle as Max suggested it. |
e6862fe
to
6edb57b
Compare
…to refactorUpdateManager # Conflicts: # WalletWasabi.Daemon/Global.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
I pushed a commit for suggestion about making UpdateStatus
a record
. I also fixed conflicts.
I will merge considering we had several reviews and I only changed style (the equality comparer were not custom). If what I did with the record is not what you had in mind @kiminuo please make another PR.
I will make a new PR about PeriodicRunner
Refactor UpdateManager and remove UpdateChecker
Refactor UpdateManager and remove UpdateChecker
Better to review commit-by-commit.
As the backend gets more and more disconnected from the client, we can refactor the update workflow as well.
This PR aims to remove
UpdateChecker
and use mainly theUpdateManager
(which got refactored as well).What happens here:
BackendMajorVersion
from the backend.UpdateChecker
this way.UpdateManager
and check for updates only during initialization.