Skip to content

Keep Aspire CLI notification claim timestamps consistent - #19854

Merged
Eric Erhardt (eerhardt) merged 2 commits into
mainfrom
ellahathaway-warn-outdated-aspire-cli
Sep 3, 2026
Merged

Eric Erhardt (eerhardt) merged 2 commits into
mainfrom
ellahathaway-warn-outdated-aspire-cli

Conversation

@ellahathaway

@ellahathaway Ella Hathaway (ellahathaway) commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

PR #19670 was merged by Adam Ratzman (@adamint) before the final CCR-discovered timestamp fix could be included, so this follow-up carries only that isolated correction.

The cross-window suppression handshake wrote notification claims in two places:

  • the JSON payload stored a captured createdAt value; and
  • the marker filename used a second Date.now() call after filesystem setup.

If those values differed by even 1 ms, the valid claim was classified as malformed. A live malformed claim was conservatively treated as active without first matching its CLI/version key, so selecting Don't Show Again for one CLI/version could wait behind an unrelated notification claim until that claim was released or expired.

This change passes the original captured timestamp into marker publication so the payload and filename always agree. The regression deliberately makes the two ambient clock reads differ and verifies that suppression for an unrelated CLI/version completes while the first claim remains active.

Relates to #17354. This PR intentionally does not close the issue.

Validation:

  • corepack yarn run compile-tests
  • corepack yarn run unit-test --grep "outdatedCliSuppressionStore": 7 passed
  • corepack yarn run lint
  • Latest CI: 63 successful checks and 15 expected skips
  • Three-model CCR: clean
  • Latest Copilot review: zero new comments

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Use one captured timestamp for notification claim payloads and filenames so valid claims never block unrelated suppressions as malformed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 06ff4fb7-3a0a-4a61-8653-8345b646778c
Copilot AI balanced review requested due to automatic review settings September 2, 2026 01:57
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19854

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19854"

@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix correctly addresses the race and includes regression coverage for the reported failure mode.

Pull request overview

Ensures notification claim filenames and JSON payloads use the same timestamp, preventing valid claims from being treated as malformed.

Changes:

  • Passes the captured claim timestamp into marker publication.
  • Adds regression coverage for differing ambient clock reads.
File summaries
File Description
extension/src/utils/outdatedCliSuppressionStore.ts Reuses the claim timestamp in its marker filename.
extension/src/test/outdatedCliSuppressionStore.test.ts Verifies timestamp consistency and unrelated suppression progress.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The production fix is focused and regression-tested; the remaining test-cleanup comment is non-blocking.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread extension/src/test/outdatedCliSuppressionStore.test.ts
Enter cleanup before claim creation so failures cannot leak the global Date.now stub into later extension tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 06ff4fb7-3a0a-4a61-8653-8345b646778c
Copilot AI review requested due to automatic review settings September 2, 2026 02:20
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Tests selector

0 / 99 PR test projects · 2 PR jobs · 0 advisory-only targets, from 2 changed files.

Selected PR test projects (0 / 99)

none — no PR-gated .NET test projects run for this change.

Selected PR jobs (2)

extension-e2e, extension-unit

Advisory workflow impact (0)

none


How these were chosen — grouped by what changed

Job reasons

Job Triggered by
extension-e2e extension/src/test/outdatedCliSuppressionStore.test.ts, extension/src/utils/outdatedCliSuppressionStore.ts
extension-unit extension/src/test/outdatedCliSuppressionStore.test.ts, extension/src/utils/outdatedCliSuppressionStore.ts

Selection computed for commit 8430ca0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix is correct and includes regression coverage for the reported race.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@eerhardt
Eric Erhardt (eerhardt) merged commit 8780cb1 into main Sep 3, 2026
79 checks passed
@eerhardt
Eric Erhardt (eerhardt) deleted the ellahathaway-warn-outdated-aspire-cli branch September 3, 2026 18:19
@github-actions github-actions Bot added this to the 13.6 milestone Sep 3, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.6 milestone Sep 3, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch taken: docs_required → false positive, no concrete documentation edit

Triggered signals (1): pr_body_has_cli_flag_mention — evidence: "yarn run unit-test --grep \"outdatedCliSuppressionStore\": 7 passed - corepack yarn r" from the PR body.

On inspection, this is a false positive: the matched --grep text is a flag for the yarn/mocha test runner command shown in the PR's own validation checklist ("corepack yarn run unit-test --grep ..."), not an Aspire CLI flag or any user-facing feature.

The actual change is an internal bug fix in the VS Code extension's outdatedCliSuppressionStore.ts — it makes the timestamp captured for a notification-claim JSON payload and the timestamp used in the claim marker filename consistent (both now derive from a single captured value instead of two separate Date.now() calls), fixing a race where a valid "Don't Show Again" claim could be misclassified as malformed and block suppression for an unrelated CLI/version. This is purely internal implementation detail of the cross-window suppression handshake — there is no new/changed public API, CLI flag, command, option, or other user-facing surface to document; the extension's notification-suppression behavior for users is unchanged (that behavior is already correct, this just fixes flaky internal timing logic that could occasionally violate it). No documentation edit is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants