Skip to content

Improved hidden service handling and event management - #243

Open
yallie wants to merge 17 commits into
theRainbird:auth-refactorfrom
yallie:auth-refactor
Open

yallie wants to merge 17 commits into
theRainbird:auth-refactorfrom
yallie:auth-refactor

Conversation

@yallie

@yallie yallie commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator
  1. Hidden system services shouldn't be remotely callable:
var proxy = client.CreateProxy<IDelegateProxyFactory>();
proxy.Create(typeof(Action), null)); // throws RemoteInvocationException: service is hidden
  1. IDependencyInjectionContainer should be resolvable:
public class MyCustomService(IDependencyInjectionContainer container)
{
     // container can be used to resolve other services on demand
}
  1. Added a hidden server-side service for invoking events:
// server component can relay other service's events
eventDispatcher.Invoke<ITestService>(s => nameof(s.ServiceEvent), EventArgs.Empty);
  1. Added reverse index to ClientDelegateRegistry for faster lookup by delegate + proxy pair:
var indexKey = (clientDelegate, serviceProxy); // key is allocated on stack, not heap

if (_reverseIndex.TryGetValue(indexKey, out var existing)) // O(1) lookup
    return existing;
  1. Implemented event subscription tracker, to compare active subscriptions on client and server:
var proxy = client.CreateProxy<ITestService>();
proxy.ServiceEvent += eventHandler;

Assert.Equal(1, client.SubscriptionTracker.Count); // SubscriptionTracker is internal, not a public API
Assert.Equal(client.SubscriptionTracker.Checksum, serverTracker.Checksum);

@yallie yallie mentioned this pull request Oct 17, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant