Releases: ConfigDirector/swift-sdk
Releases · ConfigDirector/swift-sdk
Release list
v1.1.0
Changed
- A
baseURLwhose path has no trailing slash, such ashttps://proxy.example.com/configdirector,
now keeps that path when the SDK builds its endpoints. It used to resolve relative to the parent,
dropping the last path component. - In
.pollingmode, a transient failure on the first fetch ofinitialize(context:)or
updateContext(_:)no longer returns early with an error. The context is applied, polling
continues on the interval, and the call waits for the first successful poll up to the timeout,
the way.streamingmode already behaved. A.oneTimeclient, which never retries, still
reports the failure and keeps the previous context. ConsoleLoggerwrites debug messages as private, since they carry config values. They are shown
in full while a debugger is attached and redacted from the unified log otherwise. Warnings and
errors are still public.- Reconnection delays in
.streamingmode are spread out with jitter, and a connection that opens
but delivers nothing no longer resets the backoff.
Fixed
- A
values(for:default:)stream now falls back to its default when a full config update no
longer carries its config. It used to keep yielding the last value it had seen. - Passing
.infinityastimeoutorpollingIntervalno longer traps. updateContext(_:)calls that overlap, or that race with the reconnection performed when the
app returns to the foreground, now apply in the order they were made. The last one made is the
one that wins..readyis no longer published before the new context is in effect when config state arrives
on the heels of the connection opening.- In
.pollingmode, anupdateContext(_:)after an unrecoverable error now logs that error
again instead of claiming the client will keep retrying, and the network is left alone when
pauseNetwork()orclose()is called while a connection attempt is in flight. - The
Last-Event-IDheader is omitted after the server resets the event id to empty, as the
server-sent events specification requires. - A rejected response's body is cut to 200 characters in the error message.
- Telemetry no longer attributes an evaluation to the context it was not made against. Reading a
config immediately afterupdateContext(_:)returned could be reported in the batch belonging to
the previous context, because the collector was told about the new context in a detached task
that had not necessarily run yet.
v1.0.0
Added
ConfigDirectorClient, evaluating configs against aConfigDirectorContextofid,name,
traitsandisAnonymous.updateContext(_:)re-evaluates every config against a new identity,
keeping the previous one in effect until the reconnection succeeds or times out.- Synchronous
value(for:default:), safe to call from a SwiftUIbody.Bool,String,Intand
Doubleare supported, and any type can be read from a config by conforming toConfigValue. value(for:as:default:), decoding a JSON config into anyDecodabletype.values(for:default:), anAsyncStreamthat yields the current value on subscription and then
each change, without re-emitting a value that did not change.- Three connection modes:
.streamingover server-sent events,.pollingon an interval, and
.oneTime. Streaming reconnects on its own with a backoff, and stops on an unrecoverable status. - Telemetry that aggregates config evaluations and reports them off the caller's thread, so
evaluating a config never waits on the network. pausesWhileBackgrounded, dropping the connection while the app is backgrounded and restoring it
on return, pluspauseNetwork()andresumeNetwork()to drive that manually.eventsandevaluationsstreams, publishing client lifecycle changes and every individual
config evaluation.ConfigDirectorLogger, with aConsoleLoggerwriting to the unified logging system under the
com.configdirector.sdksubsystem.- Support for iOS 15, iPadOS 15, macOS 12, tvOS 15 and watchOS 8, built in Swift 6 language mode
under strict concurrency, with every public typeSendable.