Skip to content

Commit a6d94a9

Browse files
Release 5.4.4 (#260)
## [5.4.4] - 2022-01-19 ### Fixed - Fixed memory leak when stream connections are terminated by updating `LDSwiftEventSource` dependency to [1.3.0](https://github.com/launchdarkly/swift-eventsource/releases/tag/1.3.0). - The SDK would not allow additional fields on `delete` flag stream events. This has been updated to allow additional fields for improved future compatibility. - Improved internal `Throttler` implementation to reduce concurrency concerns. - Removed unneeded `Cartfile` definining `LDSwiftEventSource` dependency, which when bundled could lead to warning messages that `LDSwiftEventSource` definitions are implemented in multiple frameworks.
1 parent 7e24a7a commit a6d94a9

22 files changed

+209
-336
lines changed

.circleci/config.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
type: string
99
ssh-fix:
1010
type: boolean
11-
default: true
11+
default: false
1212
build-doc:
1313
type: boolean
1414
default: false
@@ -24,19 +24,15 @@ jobs:
2424
steps:
2525
- checkout
2626

27-
# This hack shouldn't be necessary, as we don't actually use SSH
28-
# to get any dependencies, but for some reason starting in the
29-
# '12.0.0' Xcode image it's become necessary.
27+
# There's an XCode bug present in the 12.0.1 CircleCI image that prevents fetching SSH
28+
# dependencies from working in some cases, so we disable CircleCI's rewriting of the HTTPS
29+
# GitHub URLs to SSH.
3030
- when:
3131
condition: <<parameters.ssh-fix>>
3232
steps:
3333
- run:
34-
name: SSH fingerprint fix
35-
command: |
36-
sudo defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES
37-
rm ~/.ssh/id_rsa || true
38-
for ip in $(dig @8.8.8.8 bitbucket.org +short); do ssh-keyscan bitbucket.org,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
39-
for ip in $(dig @8.8.8.8 github.com +short); do ssh-keyscan github.com,$ip; ssh-keyscan $ip; done 2>/dev/null >> ~/.ssh/known_hosts || true
34+
name: SSH fix
35+
command: git config --global --unset url.ssh://git@github.com.insteadof
4036

4137
- run:
4238
name: Setup for builds
@@ -87,11 +83,25 @@ jobs:
8783
- when:
8884
condition: <<parameters.build-doc>>
8985
steps:
86+
- restore_cache:
87+
key: v1-gem-cache-<<parameters.xcode-version>>-
88+
9089
- run:
91-
name: Build Documentation
90+
name: Install jazzy gem
9291
command: |
93-
sudo gem install jazzy
94-
jazzy -o artifacts/docs
92+
gem install jazzy
93+
gem cleanup
94+
# Used as cache key to prevent storing redundant caches
95+
gem list > /tmp/cache-key.txt
96+
97+
- save_cache:
98+
key: v1-gem-cache-<<parameters.xcode-version>>-{{ checksum "/tmp/cache-key.txt" }}
99+
paths:
100+
- ~/.gem
101+
102+
- run:
103+
name: Build Documentation
104+
command: jazzy -o artifacts/docs
95105

96106
- when:
97107
condition: <<parameters.run-lint>>
@@ -116,18 +126,22 @@ workflows:
116126

117127
build:
118128
jobs:
129+
- build:
130+
name: Xcode 13.1 - Swift 5.5
131+
xcode-version: '13.1.0'
132+
ios-sim: 'platform=iOS Simulator,name=iPhone 11,OS=15.0'
133+
build-doc: true
134+
run-lint: true
119135
- build:
120136
name: Xcode 12.5 - Swift 5.4
121137
xcode-version: '12.5.0'
122138
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.5'
123-
build-doc: true
124-
run-lint: true
125139
- build:
126140
name: Xcode 12.0 - Swift 5.3
127141
xcode-version: '12.0.1'
128142
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=14.0'
143+
ssh-fix: true
129144
- build:
130145
name: Xcode 11.4 - Swift 5.2
131146
xcode-version: '11.4.1'
132147
ios-sim: 'platform=iOS Simulator,name=iPhone 8,OS=12.2'
133-
ssh-fix: false

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to the LaunchDarkly iOS SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [5.4.4] - 2022-01-19
6+
### Fixed
7+
- Fixed memory leak when stream connections are terminated by updating `LDSwiftEventSource` dependency to [1.3.0](https://github.com/launchdarkly/swift-eventsource/releases/tag/1.3.0).
8+
- The SDK would not allow additional fields on `delete` flag stream events. This has been updated to allow additional fields for improved future compatibility.
9+
- Improved internal `Throttler` implementation to reduce concurrency concerns.
10+
- Removed unneeded `Cartfile` definining `LDSwiftEventSource` dependency, which when bundled could lead to warning messages that `LDSwiftEventSource` definitions are implemented in multiple frameworks.
11+
512
## [5.4.3] - 2021-08-13
613
### Fixed
714
- Fixed an issue where `304 NOT_MODIFIED` responses to SDK polling mode requests would be considered error responses. This could cause the completion on a `identify` request to not complete, and gave erroneous connection information data and logging output.

Cartfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

LaunchDarkly.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |ld|
33

44
ld.name = "LaunchDarkly"
5-
ld.version = "5.4.3"
5+
ld.version = "5.4.4"
66
ld.summary = "iOS SDK for LaunchDarkly"
77

88
ld.description = <<-DESC
@@ -35,6 +35,6 @@ Pod::Spec.new do |ld|
3535
ld.swift_version = '5.0'
3636

3737
ld.subspec 'Core' do |es|
38-
es.dependency 'LDSwiftEventSource', '1.2.1'
38+
es.dependency 'LDSwiftEventSource', '1.3.0'
3939
end
4040
end

LaunchDarkly.xcodeproj/project.pbxproj

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@
15831583
GCC_C_LANGUAGE_STANDARD = gnu11;
15841584
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
15851585
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1586-
MARKETING_VERSION = 5.4.3;
1586+
MARKETING_VERSION = 5.4.4;
15871587
MODULEMAP_FILE = "";
15881588
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
15891589
PRODUCT_NAME = LaunchDarkly_tvOS;
@@ -1606,7 +1606,7 @@
16061606
GCC_C_LANGUAGE_STANDARD = gnu11;
16071607
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
16081608
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1609-
MARKETING_VERSION = 5.4.3;
1609+
MARKETING_VERSION = 5.4.4;
16101610
MODULEMAP_FILE = "";
16111611
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-tvOS";
16121612
PRODUCT_NAME = LaunchDarkly_tvOS;
@@ -1629,7 +1629,7 @@
16291629
GCC_C_LANGUAGE_STANDARD = gnu11;
16301630
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
16311631
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1632-
MARKETING_VERSION = 5.4.3;
1632+
MARKETING_VERSION = 5.4.4;
16331633
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
16341634
PRODUCT_NAME = LaunchDarkly_macOS;
16351635
SDKROOT = macosx;
@@ -1650,7 +1650,7 @@
16501650
GCC_C_LANGUAGE_STANDARD = gnu11;
16511651
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
16521652
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1653-
MARKETING_VERSION = 5.4.3;
1653+
MARKETING_VERSION = 5.4.4;
16541654
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-macOS";
16551655
PRODUCT_NAME = LaunchDarkly_macOS;
16561656
SDKROOT = macosx;
@@ -1694,7 +1694,7 @@
16941694
CURRENT_PROJECT_VERSION = 1;
16951695
DEBUG_INFORMATION_FORMAT = dwarf;
16961696
DYLIB_COMPATIBILITY_VERSION = 5.4.0;
1697-
DYLIB_CURRENT_VERSION = 5.4.3;
1697+
DYLIB_CURRENT_VERSION = 5.4.4;
16981698
ENABLE_STRICT_OBJC_MSGSEND = YES;
16991699
ENABLE_TESTABILITY = YES;
17001700
FRAMEWORK_VERSION = B;
@@ -1765,7 +1765,7 @@
17651765
CURRENT_PROJECT_VERSION = 1;
17661766
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
17671767
DYLIB_COMPATIBILITY_VERSION = 5.4.0;
1768-
DYLIB_CURRENT_VERSION = 5.4.3;
1768+
DYLIB_CURRENT_VERSION = 5.4.4;
17691769
ENABLE_NS_ASSERTIONS = NO;
17701770
ENABLE_STRICT_OBJC_MSGSEND = YES;
17711771
FRAMEWORK_VERSION = B;
@@ -1804,7 +1804,7 @@
18041804
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
18051805
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
18061806
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
1807-
MARKETING_VERSION = 5.4.3;
1807+
MARKETING_VERSION = 5.4.4;
18081808
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
18091809
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
18101810
PRODUCT_NAME = LaunchDarkly;
@@ -1824,7 +1824,7 @@
18241824
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
18251825
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
18261826
LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
1827-
MARKETING_VERSION = 5.4.3;
1827+
MARKETING_VERSION = 5.4.4;
18281828
MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap";
18291829
PRODUCT_BUNDLE_IDENTIFIER = com.launchdarkly.Darkly;
18301830
PRODUCT_NAME = LaunchDarkly;
@@ -1866,7 +1866,7 @@
18661866
GCC_C_LANGUAGE_STANDARD = gnu11;
18671867
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
18681868
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1869-
MARKETING_VERSION = 5.4.3;
1869+
MARKETING_VERSION = 5.4.4;
18701870
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
18711871
PRODUCT_NAME = LaunchDarkly_watchOS;
18721872
SDKROOT = watchos;
@@ -1888,7 +1888,7 @@
18881888
GCC_C_LANGUAGE_STANDARD = gnu11;
18891889
INFOPLIST_FILE = "$(PROJECT_DIR)/LaunchDarkly/LaunchDarkly/Support/Info.plist";
18901890
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
1891-
MARKETING_VERSION = 5.4.3;
1891+
MARKETING_VERSION = 5.4.4;
18921892
PRODUCT_BUNDLE_IDENTIFIER = "com.launchdarkly.Darkly-watchOS";
18931893
PRODUCT_NAME = LaunchDarkly_watchOS;
18941894
SDKROOT = watchos;
@@ -1962,7 +1962,7 @@
19621962
repositoryURL = "https://github.com/LaunchDarkly/swift-eventsource.git";
19631963
requirement = {
19641964
kind = exactVersion;
1965-
version = 1.2.1;
1965+
version = 1.3.0;
19661966
};
19671967
};
19681968
B4903D9624BD61B200F087C4 /* XCRemoteSwiftPackageReference "OHHTTPStubs" */ = {
@@ -1978,15 +1978,15 @@
19781978
repositoryURL = "https://github.com/Quick/Nimble.git";
19791979
requirement = {
19801980
kind = exactVersion;
1981-
version = 9.2.0;
1981+
version = 9.2.1;
19821982
};
19831983
};
19841984
B4903D9C24BD61EF00F087C4 /* XCRemoteSwiftPackageReference "Quick" */ = {
19851985
isa = XCRemoteSwiftPackageReference;
19861986
repositoryURL = "https://github.com/Quick/Quick.git";
19871987
requirement = {
19881988
kind = exactVersion;
1989-
version = 3.1.2;
1989+
version = 4.0.0;
19901990
};
19911991
};
19921992
/* End XCRemoteSwiftPackageReference section */

LaunchDarkly/LaunchDarkly/Models/ErrorObserver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Foundation
99

1010
struct ErrorObserver {
1111
weak var owner: LDObserverOwner?
12-
var errorHandler: LDErrorHandler?
12+
let errorHandler: LDErrorHandler
1313

1414
init(owner: LDObserverOwner, errorHandler: @escaping LDErrorHandler) {
1515
self.owner = owner

LaunchDarkly/LaunchDarkly/ServiceObjects/DiagnosticReporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DiagnosticReporter: DiagnosticReporting {
4747
sendDiagnosticEventAsync(diagnosticEvent: initEvent)
4848
}
4949

50-
timer = LDTimer(withTimeInterval: service.config.diagnosticRecordingInterval, repeats: true, fireQueue: workQueue) {
50+
timer = LDTimer(withTimeInterval: service.config.diagnosticRecordingInterval, fireQueue: workQueue) {
5151
self.sendDiagnosticEventSync(diagnosticEvent: cache.getCurrentStatsAndReset())
5252
}
5353
}

LaunchDarkly/LaunchDarkly/ServiceObjects/EnvironmentReporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct EnvironmentReporter: EnvironmentReporting {
135135
var shouldThrottleOnlineCalls: Bool { true }
136136
#endif
137137

138-
let sdkVersion = "5.4.3"
138+
let sdkVersion = "5.4.4"
139139
// Unfortunately, the following does not function in certain configurations, such as when included through SPM
140140
// var sdkVersion: String {
141141
// Bundle(for: LDClient.self).infoDictionary?["CFBundleShortVersionString"] as? String ?? "5.x"

LaunchDarkly/LaunchDarkly/ServiceObjects/ErrorNotifier.swift

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,15 @@ final class ErrorNotifier: ErrorNotifying {
2222
}
2323

2424
func removeObservers(for owner: LDObserverOwner) {
25-
errorObservers = errorObservers.filter { $0.owner !== owner }
25+
errorObservers.removeAll { $0.owner === owner }
2626
}
2727

2828
func notifyObservers(of error: Error) {
2929
removeOldObservers()
30-
errorObservers.forEach { $0.errorHandler?(error) }
30+
errorObservers.forEach { $0.errorHandler(error) }
3131
}
3232

3333
private func removeOldObservers() {
3434
errorObservers = errorObservers.filter { $0.owner != nil }
3535
}
3636
}
37-
38-
#if DEBUG
39-
extension ErrorNotifier {
40-
func erase(owner: LDObserverOwner) {
41-
for index in 0..<errorObservers.count {
42-
guard errorObservers[index].owner === owner
43-
else { continue }
44-
errorObservers[index].owner = nil
45-
}
46-
}
47-
}
48-
#endif

LaunchDarkly/LaunchDarkly/ServiceObjects/EventReporter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class EventReporter: EventReporting {
9797
private func startReporting(isOnline: Bool) {
9898
guard isOnline && !isReportingActive
9999
else { return }
100-
eventReportTimer = LDTimer(withTimeInterval: service.config.eventFlushInterval, repeats: true, fireQueue: eventQueue, execute: reportEvents)
100+
eventReportTimer = LDTimer(withTimeInterval: service.config.eventFlushInterval, fireQueue: eventQueue, execute: reportEvents)
101101
}
102102

103103
private func stopReporting() {

0 commit comments

Comments
 (0)