-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[release/v7.5.6] Delay update notification for one week to ensure all packages become available #27220
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
[release/v7.5.6] Delay update notification for one week to ensure all packages become available #27220
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -28,6 +28,9 @@ internal static class UpdatesNotification | |||||||||||
| private const string StableBuildInfoURL = "https://aka.ms/pwsh-buildinfo-stable"; | ||||||||||||
| private const string PreviewBuildInfoURL = "https://aka.ms/pwsh-buildinfo-preview"; | ||||||||||||
|
|
||||||||||||
| private const int NotificationDelayDays = 7; | ||||||||||||
| private const int UpdateCheckBackoffDays = 7; | ||||||||||||
|
|
||||||||||||
| /// <summary> | ||||||||||||
| /// The version of new update is persisted using a file, not as the file content, but instead baked in the file name in the following template: | ||||||||||||
| /// `update{notification-type}_{version}_{publish-date}` -- held by 's_updateFileNameTemplate', | ||||||||||||
|
|
@@ -89,9 +92,18 @@ internal static void ShowUpdateNotification(PSHostUserInterface hostUI) | |||||||||||
| if (TryParseUpdateFile( | ||||||||||||
| updateFilePath: out _, | ||||||||||||
| out SemanticVersion lastUpdateVersion, | ||||||||||||
| lastUpdateDate: out _) | ||||||||||||
| out DateTime lastUpdateDate) | ||||||||||||
| && lastUpdateVersion != null) | ||||||||||||
| { | ||||||||||||
| DateTime today = DateTime.UtcNow; | ||||||||||||
| if ((today - lastUpdateDate).TotalDays < NotificationDelayDays) | ||||||||||||
|
Comment on lines
+98
to
+99
|
||||||||||||
| DateTime today = DateTime.UtcNow; | |
| if ((today - lastUpdateDate).TotalDays < NotificationDelayDays) | |
| DateTime today = DateTime.UtcNow.Date; | |
| DateTime lastUpdateUtcDate = lastUpdateDate.ToUniversalTime().Date; | |
| if ((today - lastUpdateUtcDate).TotalDays < NotificationDelayDays) |
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 PR is described as a backport of #27095, which (per the linked PR summary) also increases the update-check backoff from 7 to 14 days. In this backport,
UpdateCheckBackoffDaysis still set to 7, so either the backport is incomplete or the PR description/linkage should be updated to reflect that only the notification delay is being backported.