Client.Shared EndpointSelector duplicates the OPC UA endpoint URL rewrite now shared by driver + AdminUI browser #812
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Fixed on master (merge 62d83bc0;
90491aa8,d52a3b1c). Client.Shared now references Driver.OpcUaClient.Contracts (no SDK/NuGet deps, guarded by ContractsIsDependencyLightTests) andEndpointSelector.SelectBestuses the sharedOpcUaEndpointUrlRewriter. 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).