You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛 Missing Public Initializer in HttpConnectionOptions Prevents External Customization
Summary
HttpConnectionOptions is a public struct with many configurable public properties such as accessTokenFactory, but it lacks a public init(), making it impossible to initialize from outside the module.
Problem
Although the library exposes HubConnectionBuilder.withUrl(url:options:), consumers cannot use this method effectively because they cannot instantiate a HttpConnectionOptions object.
For example, the following code is not possible due to lack of a public initializer:
varoptions=HttpConnectionOptions() // ⛔️ Error: init is inaccessible
options.accessTokenFactory ={return"my-token"}
Proposed Fix
Expose a public init() inside HttpConnectionOptions to allow consumers to create and configure the struct from their own code. This was already mentioned here#65 and as issue here
PR
This issue is being addressed in the following pull request: #76
Benefit
This change would unblock valid usage patterns for setting authentication and other details when building SignalR connections using the Swift client SDK.
The text was updated successfully, but these errors were encountered:
🐛 Missing Public Initializer in
HttpConnectionOptions
Prevents External CustomizationSummary
HttpConnectionOptions
is apublic struct
with many configurablepublic
properties such asaccessTokenFactory
, but it lacks apublic init()
, making it impossible to initialize from outside the module.Problem
Although the library exposes
HubConnectionBuilder.withUrl(url:options:)
, consumers cannot use this method effectively because they cannot instantiate aHttpConnectionOptions
object.For example, the following code is not possible due to lack of a public initializer:
Proposed Fix
Expose a public init() inside HttpConnectionOptions to allow consumers to create and configure the struct from their own code. This was already mentioned here #65 and as issue here
PR
This issue is being addressed in the following pull request: #76
Benefit
This change would unblock valid usage patterns for setting authentication and other details when building SignalR connections using the Swift client SDK.
The text was updated successfully, but these errors were encountered: