-
Notifications
You must be signed in to change notification settings - Fork 23
In-memory / patch.json fix for compatibility update #209
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
base: master
Are you sure you want to change the base?
Conversation
First of all: Thank you for taking care of this issue #10.
Sorry, I have not taken the time to understand the original code, but it seems that the compatibility information is separate from the JSON file of a Patch (from the Web Catalog), so it can be and is separately downloaded and evaluated? But it looks like you ultimately implemented this nicely WRT usability while retaining the original, slightly complicated design. 😀 |
I'm not very happy with how things are:) As you can see, The workflow was: if The 2nd take was like: ok, I don't have the patch.json immediately available because we're just checking for updates. But, if the current version has a newer/different compatibility field, let's store just that silently. It is still up for testing.. you need a patch to edit the versions back and forth and somehow trigger the check-for-updates (I think closing the Settings ui and re-opening it then going to Patchmanager) |
Regarding downloading a fresh patch.json: maybe the whole patch could be re-downloaded if the (same) version changes. But then, maybe the author broke something, I wouldn't do that automatically. This little hack should probably be more guarded around "only if the compatibility list added some new versions" too. I'm open to ideas how to make this better (considering the code around is already a bit convoluted. Maybe I should bite the bullet and simplify some, but not today:) |
Absolutely true (i.e., things are often not as simple as they seem)! |
Yes, if nothing was changed, except for some additional SailfishOS release(s) on the compatibility list, this approach is safe AFAICS. |
I'm still not clear on what the ideal workflow or algorithm should look like. AFAICS we have these cases:
(Oh and maybe the whole checking thing could just be replaced with a nuclear option: "redownload all patches", and "redownload/update all compatible patches", user triggered, and let them keep the pieces. |
@nephros, issue #10 is only about your case 5: Solely something in the
Honestly, I have not explicitly thought about this before, but simply assumed, "when the Web Catalog is checked for updates". |
Sorry for the delay answering here. This PR only detects "same-version, but become-compatible" changes (or that's the goal). It runs at web catalog update check indeed. And it then only changes the compatibility of the stored patch json. |
This should fix #10
However this only updates the in-memory model at check-for-updates. So it will 'work' only as long as you have once checked for updates successfully during a daemon instance run.
The patch.json file is not re-written with the new contents.What would the side effects of that be?
Actually I've updated just the compatibility part of the patch.json