-
Notifications
You must be signed in to change notification settings - Fork 35
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
updata: fix fetching max version in remove-update #362
base: develop
Are you sure you want to change the base?
Conversation
@@ -118,7 +118,7 @@ impl RemoveUpdateArgs { | |||
}); | |||
// Note: We don't revert the maximum version on removal | |||
update_metadata::write_file(&self.file, &manifest)?; | |||
if let Some(current) = manifest.updates.first() { | |||
if let Some(current) = manifest.updates.last() { |
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.
Is this just not sorted? I would expect to need to sort it to always get the max version?
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 is sorted in a reversed order. I will adjust the code to enforce a sort here so that we get deterministic result.
Can you open an issue with more details about the bug you're fixing? "max version" is (incorrectly) associated with each update's metadata instead of being set once at the top level of In the meantime, tools ( Just from a practical perspective: fixing |
Just created the issue - #366. Right now Now I think the simple fix would probably be to just use |
- When running the remove-update command it would report the max version available in the manifest. But it is checking the wrong order so that the latest version is not correctly reported. This is a simple fix for that. Instead of reading the version, we read the max_version field so that the max version is correctly captured. Signed-off-by: Yutong Sun <[email protected]>
6662d30
to
dc50ff0
Compare
Issue number:
Closes # N/A
Description of changes:
Testing done:
Before the fix:
After:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.