Cached file listing outdated packages is not updated when there are no changes #978
Closed
4 tasks done
Labels
5 - Released
The issue has been resolved, and released to the public for consumption
Bug
Issues where something has happened which was not expected or intended
Milestone
Checklist
What You Are Seeing?
When configured to do so, Chocolatey GUI figures out all of the outdated packages that are currently installed on the system and writes this information to a file in the users
AppData\Local\Chocolatey GUI
folder. This file is calledoutdatedPackages.xml
. The idea is that this cached information will be used to display the outdated packages within the UI, without having to always fetch this information. There is also a setting within the Chocolatey GUI calledoudatedPackagesCacheDurationsInMinutes
which defaults to 60. This setting is used to tell Chocolatey GUI how long it should wait before invalidating the cached file.Currently, when the 60 minutes expires, Chocolatey GUI correctly fetches the outdated information and attempts to update the cached file, but when there are no changes to the information (i.e. the hash of the file is exactly the same) the file never gets updated, and continues to have the original modified time.
As a result, when the outdated packages is never changing, Chocolatey GUI will continue to unnecessarily fetch outdated information every time, even though the information was fetched, the file was never updated.
This is due to the usage of the
XmlService
in the Chocolatey.Lib, where it only serializes a file to disk, when it is known that that file has changed. In some cases, this is exactly what you want, but the use case in Chocolatey GUI relies on the timestamp applied to the file when it modified to know that an action is required.What is Expected?
When information about outdated packages is fetched, the cached file should always be written, regardless of whether the information is the same or not. This will ensure correct usage of the cached file, and prevent unnecessary fetching of information.
How Did You Get This To Happen?
oudatedPackagesCacheDurationsInMinutes
to a lower value so that is isn't necessary to wait 60 minutes to see this happenchoco install vlc --version 3.0.16
AppData\Local\Chocolatey GUI
folder and inspect the modified date of theoutdatedPackages.xml
fileSystem Details
Installed Packages
Output Log
Additional Context
This was found during investigations into what was required to bring Chocolatey GUI Licensed Extension up to date with the latest alpha version of Chocolatey.Lib.
The text was updated successfully, but these errors were encountered: