Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Conversation

PederHP
Copy link
Owner

@PederHP PederHP commented Mar 16, 2025

Fix resource subscription handling
Add resource subscription tests

Note that the 'everything' server supports resource subscription in the git repo, but the version on npx does not. Hence the lack of integration test against the reference server.

I've added subscribe and unsubscribe logic corresponding to that described in the everything docs to the library (stdio) testserver.

Let's merge #87 before this one (I'll make the changes related to capabilities and handlers in this PR to align with it, once it's merged).

Add resource subscription tests
@PederHP PederHP requested a review from stephentoub March 16, 2025 15:42
@stephentoub
Copy link
Collaborator

Let's merge #87 before this one (I'll make the changes related to capabilities and handlers in this PR to align with it, once it's merged).

Merged. I'll review this PR once you've fixed up the conflicts. Thanks!

stephentoub
stephentoub previously approved these changes Mar 16, 2025
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
42.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@PederHP
Copy link
Owner Author

PederHP commented Mar 17, 2025

This PR is ready for review again.

}

private static HashSet<string> _subscribedResources = new();
private static readonly object _subscribedResourcesLock = new();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could also use a ConcurrentDictionary, but this is fine.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, I considered that, but thought it was overkill for a test server.

@PederHP PederHP merged commit 34a6f1c into main Mar 17, 2025
1 of 2 checks passed
@PederHP PederHP deleted the fix_resource_subscription branch March 17, 2025 16:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants