Client.Shared EndpointSelector duplicates the OPC UA endpoint URL rewrite now shared by driver + AdminUI browser #812

Closed
opened 2026-11-10 21:39:41 -05:00 by dohertj2 · 1 comment
Owner

After #806 the advertised-endpoint host/port rewrite lives once in Driver.OpcUaClient.Contracts/OpcUaEndpointUrlRewriter.cs (dependency-light, URL strings only) and endpoint selection in Driver.OpcUaClient.Session/OpcUaEndpointSelection.cs, used by both OpcUaClientDriver and the AdminUI OpcUaClientDriverBrowser.

Client.Shared's EndpointSelector.SelectBest (Client CLI/UI) still carries its own copy of the same rules. Client.Shared references no driver projects, so sharing needs either a reference to Driver.OpcUaClient.Contracts or moving the rewriter to a common lib. Keep behaviour identical and reuse the #806 rewrite test cases.

After #806 the advertised-endpoint host/port rewrite lives once in Driver.OpcUaClient.Contracts/OpcUaEndpointUrlRewriter.cs (dependency-light, URL strings only) and endpoint selection in Driver.OpcUaClient.Session/OpcUaEndpointSelection.cs, used by both OpcUaClientDriver and the AdminUI OpcUaClientDriverBrowser. Client.Shared's EndpointSelector.SelectBest (Client CLI/UI) still carries its own copy of the same rules. Client.Shared references no driver projects, so sharing needs either a reference to Driver.OpcUaClient.Contracts or moving the rewriter to a common lib. Keep behaviour identical and reuse the #806 rewrite test cases.
dohertj2 added the type:debtpriority:p3 labels 2026-11-10 21:39:41 -05:00
Author
Owner

Fixed on master (merge 62d83bc0; 90491aa8, d52a3b1c). Client.Shared now references Driver.OpcUaClient.Contracts (no SDK/NuGet deps, guarded by ContractsIsDependencyLightTests) and EndpointSelector.SelectBest uses the shared OpcUaEndpointUrlRewriter. Behaviour was pinned first with 19 parity cases (343/343 before and after).

The two copies differed: the shared rewriter rebuilt an unchanged URL (trailing slash, host case) and un-escaped percent-encoded paths via Uri.ToString() — fixed in the shared rewriter (returns the advertised string when nothing to rewrite; serialises with AbsoluteUri), which slightly changes driver/browser behaviour in those cosmetic cases. The client keeps its loud failure on unusable URLs. Tests: Client.Shared 343, OpcUaClient driver 353, Browser 25, Client.CLI 173, Client.UI 131. Follow-up: #819 (IPv6 zone id).

Fixed on master (merge 62d83bc0; 90491aa8, d52a3b1c). Client.Shared now references Driver.OpcUaClient.Contracts (no SDK/NuGet deps, guarded by ContractsIsDependencyLightTests) and `EndpointSelector.SelectBest` uses the shared `OpcUaEndpointUrlRewriter`. Behaviour was pinned first with 19 parity cases (343/343 before and after). The two copies differed: the shared rewriter rebuilt an unchanged URL (trailing slash, host case) and un-escaped percent-encoded paths via `Uri.ToString()` — fixed in the shared rewriter (returns the advertised string when nothing to rewrite; serialises with AbsoluteUri), which slightly changes driver/browser behaviour in those cosmetic cases. The client keeps its loud failure on unusable URLs. Tests: Client.Shared 343, OpcUaClient driver 353, Browser 25, Client.CLI 173, Client.UI 131. Follow-up: #819 (IPv6 zone id).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/lmxopcua#812