Keep Aspire CLI notification claim timestamps consistent - #19854
Conversation
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
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19854Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19854" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 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.
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
Tests selector0 / 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)
Advisory workflow impact (0)none How these were chosen — grouped by what changedJob reasons
Selection computed for commit |
|
✅ No documentation update needed. Step 5 branch taken: Triggered signals (1): On inspection, this is a false positive: the matched The actual change is an internal bug fix in the VS Code extension's |
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:
createdAtvalue; andDate.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-testscorepack yarn run unit-test --grep "outdatedCliSuppressionStore": 7 passedcorepack yarn run lintChecklist
<remarks />and<code />elements on your triple slash comments?