Fix canonical URI cache invalidation on path casing changes - #328679
Open
zainnadeem786 wants to merge 1 commit into
Open
Fix canonical URI cache invalidation on path casing changes#328679zainnadeem786 wants to merge 1 commit into
zainnadeem786 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes stale canonical URI caching when filesystem path-casing capabilities change.
Changes:
- Corrects old-versus-new casing comparison.
- Adds a focused regression test for cache invalidation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/vs/platform/uriIdentity/common/uriIdentityService.ts |
Corrects cache invalidation condition. |
src/vs/platform/uriIdentity/test/common/uriIdentityService.test.ts |
Tests runtime casing-capability changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #328677
Summary
Fix canonical URI cache invalidation when a filesystem provider's path-casing capability changes.
Root Cause
UriIdentityServicerecomputes the new per-schemeignorePathCasingvalue after a filesystem provider registration or capability-change event, but the existing implementation compares the newly computed value to itself.Because this condition is always true, the listener returns before clearing cached canonical URI entries for the affected scheme.
As a result, direct URI comparisons can reflect the updated path-casing behavior while
asCanonicalUri()continues returning URI values cached under the previous casing semantics.Change
Compare the previously cached path-casing value with the newly computed value:
This allows the existing canonical URI cache invalidation logic to run only when the provider's path-casing behavior has actually changed.
Regression Test
Added a focused URI Identity regression test that:
foo://bar/BANGwhile the provider scheme is case-insensitive;foo://bar/BANGandfoo://bar/banginitially resolve to the same canonical URI;PathCaseSensitive;asCanonicalUri(foo://bar/bang)no longer returns the stale uppercase URI.The test fails on the previous implementation and passes after the fix.
Validation
npm run compile.\scripts\test.bat --grep "asCanonicalUri clears cache when provider path casing changes"1 passing.\scripts\test.bat --grep "URI Identity"8 passing