All notable changes to the LaunchDarkly Swift EventSource library will be documented in this file. This project adheres to Semantic Versioning.
- SwiftLint configuration. Linting will be automatically run as part of the build if Mint is installed.
- Support for building docs with jazzy. These docs are available through GitHub Pages.
- Reconnection backoff was always reset if the previous successful connection was at least
backoffResetThreshold
prior to the scheduling of a reconnection attempt. The connection backoff has been corrected to not reset after the first reconnection attempt until the next successful connection. Thanks to @tomasf for the PR (#14). - On an
UnsuccessfulResponseError
the configuredconnectionErrorHandler
would be called twice, the second time with aURLError.cancelled
error. Only if the second call returnedConnectionErrorAction.shutdown
would theEventSource
client actually shutdown. This has been corrected to only call theconnectionErrorHandler
once, and will shutdown the client ifConnectionErrorAction.shutdown
is returned. Thanks to @tomasf for the PR (#13). - A race condition that could cause the
EventSource
client to restart after shutting down has been fixed.
- Added
headerTransform
closure toLDConfig
to allow dynamic http header configuration.
- Support
arm64e
onappletvos
,iphoneos
, andmacosx
SDKs by extending valid architectures. - Support for building LDSwiftEventSource on Linux. Currently this library will not generate log messages on Linux, and may not behave correctly on Linux due to Foundation being incomplete.
This is the first public release of the LDSwiftEventSource library. The following notes are what changed since the previous pre-release version.
- Renamed
EventHandler.onMessage
parameterevent
toeventType
. - The
EventSource
class no longer extendsNSObject
orURLSessionDataDelegate
to not exposeurlSession
functions.
- Default
LDSwiftEventSource
product defined for the SwiftPM package is now explicitly a dynamic product. An explicitly static product is now available asLDSwiftEventSourceStatic
.
- Converted build system to use a single target to produce a universal framework, rather than separate targets for each platform that share a product name. This is to prevent issues with
xcodebuild
resolving the build scheme to an incorrect platform when building dependent packages with 'Find Implicit Dependencies' enabled. This is due to a bug inxcodebuild
, for more information see http://www.openradar.me/20490378 and http://www.openradar.me/22008701.
- Added
stop()
method to shutdown the EventSource connection.
- Logging
subsystem
renamed fromcom.launchdarkly.swift-event-source
tocom.launchdarkly.swift-eventsource
- Public constructors for
UnsuccessfulResponseError
andMessageEvent
to allow consumers of the library to use them for unit tests.
- Initial implementation for internal alpha testing.