Conversation
…configurations Co-authored-by: Stiggimy <54530387+Stiggimy@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Relay plugin’s RPC stack and related project housekeeping, primarily migrating from Stl.* RPC packages/namespaces to ActualLab.*, and adjusting repo ignore patterns for generated/publish outputs.
Changes:
- Replace
Stl.Rpc*/Stl.Generatorsdependencies withActualLab.Rpc*/ActualLab.Generators(and addMicrosoft.Extensions.Logging). - Update RPC-related
usingdirectives and service/device RPC setup to useActualLab.Rpc. - Extend
.gitignoreto exclude additional local test/publish artifacts.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin_Relay/plugin_Relay.csproj | Swaps RPC/generator NuGet dependencies from Stl.* to ActualLab.* and adds logging package reference. |
| plugin_Relay/RelayService.cs | Updates RPC namespaces and removes the previous RpcCallRouter registration block. |
| plugin_Relay/RelayDevice.cs | Updates RPC namespace; changes client RPC wiring and removes initialization try/catch. |
| plugin_Relay/Models/Contract.cs | Updates RPC namespace import to ActualLab.Rpc. |
| .gitignore | Adds ignores for test server and publish output artifacts. |
Comments suppressed due to low confidence (1)
plugin_Relay/RelayDevice.cs:198
- RelayDevice.Initialize no longer catches initialization exceptions and no longer sets Status/InitException to a failure state. Any DI/RPC setup failure (including Host being null at the final Host.Log call) will now bubble out and can crash the plugin instead of reporting RelayDeviceStatus.ServiceError.
public void Initialize()
{
// Mark as initialized
IsInitialized = true;
MemoryPackFormatterProvider.Register(new TrackingDeviceFormatter());
MemoryPackFormatterProvider.Register(new TrackedJointFormatter());
if (RelayService.Instance?.IsBackfeed ?? false)
{
Status = RelayDeviceStatus.BackFeedDetected;
SettingsPage.DeviceStatusAppendix = string.Empty;
InitException = null;
return; // Don't proceed further
}
var services = new ServiceCollection()
.AddLogging();
services.AddRpc()
.AddWebSocketClient($"http://{ServerIp}:{ServerPort}/")
.AddClient<IRelayService>();
ServiceChannel = services.BuildServiceProvider();
Service = ServiceChannel.GetRequiredService<IRelayService>();
SettingsPage.DeviceStatusAppendix = string.Empty;
SettingsPage.StartConnectionTest();
Host.Log($"Tried to initialize with status: {DeviceStatusString}");
InitException = null;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .AddServer<IRelayClient, DataClient>(); | ||
| services.AddRpc() | ||
| .AddWebSocketClient($"http://{ServerIp}:{ServerPort}/") | ||
| .AddClient<IRelayService>(); |
There was a problem hiding this comment.
The client RPC registration no longer exposes an implementation for IRelayClient (DataClient). Since RelayService.DataService injects IRelayClient and uses it to push OnRequestShutdown/OnRefreshInterface to the client, the client needs to register an RPC server for IRelayClient (or DataService needs to be refactored to not rely on callbacks).
| .AddClient<IRelayService>(); | |
| .AddClient<IRelayService>() | |
| .AddServer<IRelayClient, DataClient>(); |
ffs im cooked
ai can't save me