Skip to content
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

Use package version as potential last update timestamp #3759

Merged
merged 7 commits into from
Oct 13, 2023

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Oct 12, 2023

Change

This change moves the background update determination to be under the control of the source reference, and then uses the package version (which is based on the creation time for us) as a potential later "last update time". This enables an update to the package from outside of our control to still prevent any update check from occurring.

Validation

New tests were added for the version to time_point conversion.
Manually confirmed functionality against winget source.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner October 12, 2023 04:39
bool IsBeforeDoNotUpdateBeforeTime(const SourceDetails& details);

// Determines if the given details and desired update interval indicate an update check should occur.
bool IsAfterUpdateCheckTime(const SourceDetails& details, std::optional<TimeSpan> requestedUpdateInterval);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this one is never being called.

@JohnMcPMS JohnMcPMS merged commit 546b509 into microsoft:master Oct 13, 2023
8 checks passed
@JohnMcPMS JohnMcPMS deleted the time-from-version branch October 13, 2023 16:07
JohnMcPMS added a commit to JohnMcPMS/winget-cli that referenced this pull request Nov 8, 2023
This change moves the background update determination to be under the control of the source reference, and then uses the package version (which is based on the creation time for us) as a potential later "last update time".  This enables an update to the package from outside of our control to still prevent any update check from occurring.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants