- 
                Notifications
    You must be signed in to change notification settings 
- Fork 715
Revert peer matching logic to fix database resource resolution regression #10456
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
Conversation
…iling tests Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
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.
Pull Request Overview
This PR reverts peer matching logic to fix a regression where database calls to uninstrumented peers no longer matched their corresponding database resources in the Aspire Dashboard. The issue was introduced in PR #10411 which changed the logic from "first one wins" to "return false if multiple resources match the same address."
Key changes:
- Restored immediate return on first match in TryMatchAgainstResourcesmethod
- Removed 5 test methods that validated the problematic "multiple matches return false" behavior
- Updated existing tests to expect the restored "first one wins" behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description | 
|---|---|
| src/Aspire.Dashboard/Model/ResourceOutgoingPeerResolver.cs | Reverted the TryMatchAgainstResourcesmethod to return immediately on first match instead of checking for multiple matches | 
| tests/Aspire.Dashboard.Tests/ResourceOutgoingPeerResolverTests.cs | Removed 5 problematic test methods and updated existing tests to validate the restored "first one wins" logic | 
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| /backport release/9.4 | 
| /backport to release/9.4 | 
| Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16333078441 | 
Problem
A regression was introduced in PR #10411 where database calls to uninstrumented peers no longer match their corresponding database resources in the Aspire Dashboard. This caused database connections to appear unmatched (with red error icons) instead of being properly linked to their database resources.
The issue occurred because the peer matching logic was changed from "first one wins" to "return false if multiple resources match the same address." While this was intended to handle ambiguous cases, it caused legitimate database connections to fail matching when multiple resources shared similar addresses.
Examples
Before (working):

After PR #10411 (broken):

The red database icon shows the call to
localhost:52074no longer matches the postgres database resource.Solution
This PR reverts the
TryMatchAgainstResourcesmethod back to the original "first one wins" logic as requested by @davidfowl for the 9.4 release:trueimmediately when a matching resource is found, instead of checking for multiple matchesCode Changes
Impact
localhost:52074) now correctly match database resourcesThis follows @davidfowl's guidance to revert PR #10411 changes for 9.4, allowing the team to design a more sophisticated approach for handling ambiguous matches in future releases.
Fixes #10452.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.