-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement auto update in Fieldworks Lite #1298
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.
This looks slick to me.
…server, if the server returns a release, then the client will update to that version
…controller, markup with otel activities
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.
The case mistakes in "FieldWorks Lite" are the only things that I think clearly need a change.
Everything else is more ideas/thoughts.
backend/FwLite/FwLiteDesktop/Platforms/Windows/WindowsShortcutService.cs
Outdated
Show resolved
Hide resolved
|
||
public static bool ShouldUpdateToRelease(string appVersion, string latestVersion) | ||
{ | ||
return String.Compare(latestVersion, appVersion, StringComparison.Ordinal) > 0; |
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.
In theory this could simlpy be appVersion != latestVersion
.
That would solve are commit-hash problem, but it makes it a lot more sensitive.
In that case, with a bit of parsing we could do a check of this form:
latest.date > app.date || latest.date == app.date && latest.hash != app.hash
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.
yeah I agree, there's a bunch of different ways we could do it, we could always chose one, but report via otel all the different ways we consider doing it, then we can see over time how they work?
preferences.Set(LastUpdateCheck, DateTime.UtcNow); | ||
return true; | ||
} | ||
if (timeSinceLastCheck.Hours < 20) return false; |
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'm fine merging this, but I think it deserves more thought.
Checking for updates is cheap.
Installing updates is not.
So, we're not really protecting from checking for updates, but maybe repeated failed updates?
If we release two updates within 24hrs then we probably have good reason to.
Maybe the logic should be more like:
- Always look for updates on start
- Don't try the same update more than once within 24hrs (unless it clearly failed due to connectivity problems?)
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.
You're right is is cheap to check. At this point I have no idea what a failed update would look like or how that would even happen considering we're not running any custom code during install. Not that I doubt it could happen. That said, tracking update attempts introduces complexity which I'd rather avoid, so maybe let's leave it as is for now and see what we learn with people actually using it and updating to new versions
Update steps:
https://lexbox.org/api/fwlite-release/latest
, can be overridden with an env variableI'm worried about fw lite failing to update itself, if that happens then it makes it hard to recover and the users will need to manually update, I want to avoid that at all costs.
Some failure modes:
We can avoid some of these but not all, I would like to get input from other devs on this.