Skip to content

Commit

Permalink
Prepare 4.2.0 release (#196)
Browse files Browse the repository at this point in the history
* Changes user-device to device model identifier (#75)

* installs new deviceModel into EnvironmentReporter and renames old deviceModel to deviceType

* use CwSysCtl for macos model

* Replaced entire flag store ff array instead of in place manipulation

* Updated CHANGELOG and bumped version number

* Added correct copy behavior to FlagStore delete and update

* Improved CHANGELOG entry for 4.0.1

* Changed version to 4.1.0, updated CHANGELOG

* Update 4.1.0 release date

* installs ios-eventsource 4.0.2

* installs CocoaPods 1.7.2

* clears swift 5 update warning

* updates circle config to use xcode 10.2.1

* advances version to 4.1.1

* installs Nimble 8.0.2

* updates SwiftLint to 0.33.0

* Update 4.1.1 release date

* Improved CHANGELOG 4.1.1 description

* Made CHANGELOG 4.1.1 more consistent

* 4.1.2 release, updated version numbers and CHANGELOG

* Made 4.1.2 CHANGELOG entry more descriptive

* Rebuilt Connection Status, added unit tests, fixed warnings

* Changed guard to equals in Dictionary extension, changed ConnectionInformation to struct

* Fixed threading issues and reference semantics

* Improved ConnectionInformation toString, fixed background behavior

* Added network connectivity check, changed TimeIntervals to Optionals

* Added Connection Status files to correct Target Membership, added conditional compilation of network connectivity check for WatchOS

* PR review changes

* More PR review changes

* Even more PR review changes

* Removed ConnectionInformationCaching, removed redundant variables

* Simplified synchronizing error behavior for connection status

* DRY up setupListeners

* Fixed string cases for LastConnectionFailureReason Codable

* Forgot to add polling last successful connection

* Store is now in Cache dir, removed listeners and 1 ldclient.shared, changed TimeInterval to Date, changed two inout's to var's

* Added ConnectionModeChangedObserver

* Fixed confusing docstring, removed unnecessary flag synchronizer

* Changed getValue and toString to description

* Changed description to computed property

* Removed connectionModeCheck

* Improved background connection status behavior

* Changed ConnectionInformation description to computed property

* Added new identify method, updated swiftlint rules

* Made Identify actually change the user, fixed unit tests

* Removed unnecessary _user assignment

* Move swiftlint disable to LDClient, move user assignment into identifyInternal

* Added private setOnline and go functions for identify

* Forgot to replace go in guard with goIdentify

* Copied user property unit tests for identify

* Added optimization to not call setOnline when there is no completion and wasOnline is false

* Testing identifyInternal change in IH

* requested PR changes

* Fixed convertCachedData call count, some PR feedback fixes

* Simplified unit tests, added comment about thread safety

* Changed lastSuccessfulConnection to lastKnownFlagValidity, added on stream close listener

* Fixed handler

* Remove unnecessary import

* Changed eventSource access level

* Reset lastKnownFlagValidity to nil when we make a successful stream connection

* Made comment about lastKnownFlagValidity having a value more clear

* Changed guard let to if let in DarklyService EventSource extension

* Updated README, CHANGELOG, and podspec for 4.2.0

* Made 4.2.0 CHANGELOG entry more detailed
  • Loading branch information
torchhound authored Oct 25, 2019
1 parent f9240ed commit 95114f0
Show file tree
Hide file tree
Showing 20 changed files with 862 additions and 79 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to the LaunchDarkly iOS SDK will be documented in this file.
### Multiple Environment clients
Version 4.0.0 does not support multiple environments. If you use version `2.14.0` or later and set `LDConfig`'s `secondaryMobileKeys` you will not be able to migrate to version `4.0.0`. Multiple Environments will be added in a future release to the Swift SDK.

## [4.2.0] - 2019-10-25
### Added
- The `identify` function allows a completion to be called after a user is updated.
- The Connection Status API allows greater introspection into the current LaunchDarkly connection and the health of local flags.
• This feature adds a new class called `ConnectionInformation` that contains properties that keep track of the current connection mode e.g. streaming or polling, when and how a connection failed, and the last time flags were updated. This class can be accessed from `LDClient.shared.getConnectionInformation`.
• Additionally, a new observer function called `observeCurrentConnectionMode` allows your application to listen to changes in the SDK's connection to LaunchDarkly.

### Changed
- The `user` property is now deprecated in favor of the `identify` function.

## [4.1.2] - 2019-07-11
### Fixed
- WatchKit is now conditionally imported in WatchOS only, to fix an error in Xcode 11.
Expand Down
4 changes: 2 additions & 2 deletions LaunchDarkly.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |ld|

ld.name = "LaunchDarkly"
ld.version = "4.1.2"
ld.version = "4.2.0"
ld.summary = "iOS SDK for LaunchDarkly"

ld.description = <<-DESC
Expand All @@ -25,7 +25,7 @@ Pod::Spec.new do |ld|
ld.tvos.deployment_target = "9.0"
ld.osx.deployment_target = "10.10"

ld.source = { :git => "https://github.com/launchdarkly/ios-client-sdk.git", :tag => '4.1.2'}
ld.source = { :git => "https://github.com/launchdarkly/ios-client-sdk.git", :tag => '4.2.0'}

ld.source_files = "LaunchDarkly/LaunchDarkly/**/*.{h,m,swift}"

Expand Down
40 changes: 40 additions & 0 deletions LaunchDarkly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,22 @@
83F0A5641FB5F33800550A95 /* LDConfigSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83F0A5631FB5F33800550A95 /* LDConfigSpec.swift */; };
83FEF8DD1F266742001CF12C /* FlagSynchronizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEF8DC1F266742001CF12C /* FlagSynchronizer.swift */; };
83FEF8DF1F2667E4001CF12C /* EventReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83FEF8DE1F2667E4001CF12C /* EventReporter.swift */; };
C408884723033B3600420721 /* ConnectionInformationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884623033B3600420721 /* ConnectionInformationStore.swift */; };
C408884923033B7500420721 /* ConnectionInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884823033B7500420721 /* ConnectionInformation.swift */; };
C443A40323145FB700145710 /* ConnectionInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884823033B7500420721 /* ConnectionInformation.swift */; };
C443A40423145FBE00145710 /* ConnectionInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884823033B7500420721 /* ConnectionInformation.swift */; };
C443A40523145FBF00145710 /* ConnectionInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884823033B7500420721 /* ConnectionInformation.swift */; };
C443A40623145FED00145710 /* ConnectionInformationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884623033B3600420721 /* ConnectionInformationStore.swift */; };
C443A40723145FEE00145710 /* ConnectionInformationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884623033B3600420721 /* ConnectionInformationStore.swift */; };
C443A40823145FEE00145710 /* ConnectionInformationStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = C408884623033B3600420721 /* ConnectionInformationStore.swift */; };
C443A40A2315AA4D00145710 /* NetworkReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A4092315AA4D00145710 /* NetworkReporter.swift */; };
C443A40B2315AA4D00145710 /* NetworkReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A4092315AA4D00145710 /* NetworkReporter.swift */; };
C443A40C2315AA4D00145710 /* NetworkReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A4092315AA4D00145710 /* NetworkReporter.swift */; };
C443A40D2315AA4D00145710 /* NetworkReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A4092315AA4D00145710 /* NetworkReporter.swift */; };
C443A40F23186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */; };
C443A41023186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */; };
C443A41123186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */; };
C443A41223186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */; };
E48F5215B96AE48D10185962 /* Pods_LaunchDarkly_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DB95B7FEBDC1E23F47304829 /* Pods_LaunchDarkly_tvOS.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -440,6 +456,10 @@
94D29EF04A706E975E771E84 /* Pods_LaunchDarkly_watchOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaunchDarkly_watchOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AC953A896A624F4525C218E5 /* Pods-LaunchDarkly_watchOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaunchDarkly_watchOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LaunchDarkly_watchOS/Pods-LaunchDarkly_watchOS.debug.xcconfig"; sourceTree = "<group>"; };
B0A56C29F8C0E59F338F9A07 /* Pods-LaunchDarkly_tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaunchDarkly_tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-LaunchDarkly_tvOS/Pods-LaunchDarkly_tvOS.release.xcconfig"; sourceTree = "<group>"; };
C408884623033B3600420721 /* ConnectionInformationStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionInformationStore.swift; sourceTree = "<group>"; };
C408884823033B7500420721 /* ConnectionInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionInformation.swift; sourceTree = "<group>"; };
C443A4092315AA4D00145710 /* NetworkReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkReporter.swift; sourceTree = "<group>"; };
C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionModeChangeObserver.swift; sourceTree = "<group>"; };
D58D143F8FD161584B3FF3AF /* Pods-LaunchDarklyTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaunchDarklyTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LaunchDarklyTests/Pods-LaunchDarklyTests.release.xcconfig"; sourceTree = "<group>"; };
D6840A437019F1CB72997480 /* Pods-LaunchDarkly_iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaunchDarkly_iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-LaunchDarkly_iOS/Pods-LaunchDarkly_iOS.release.xcconfig"; sourceTree = "<group>"; };
D8204934C417AFCE089F38BC /* Pods-LaunchDarklyTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaunchDarklyTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LaunchDarklyTests/Pods-LaunchDarklyTests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -613,6 +633,7 @@
8354AC742243168800CDE602 /* Cache */ = {
isa = PBXGroup;
children = (
C408884623033B3600420721 /* ConnectionInformationStore.swift */,
83D559731FD87CC9002D10C8 /* KeyedValueCache.swift */,
8354AC6F2243166900CDE602 /* UserEnvironmentFlagCache.swift */,
832D68A1224A38FC005F052A /* CacheConverter.swift */,
Expand Down Expand Up @@ -706,6 +727,7 @@
8354EFDE1F26380700C05156 /* Event.swift */,
83883DD4220B68A000EEAB95 /* ErrorObserver.swift */,
8354AC5F224150C300CDE602 /* Cache */,
C408884823033B7500420721 /* ConnectionInformation.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -811,6 +833,7 @@
8358F25D1F474E5900ECE1AF /* LDChangedFlag.swift */,
8358F2611F47747F00ECE1AF /* FlagChangeObserver.swift */,
83B9A081204F6022000C3F17 /* FlagsUnchangedObserver.swift */,
C443A40E23186A4F00145710 /* ConnectionModeChangeObserver.swift */,
);
path = FlagChange;
sourceTree = "<group>";
Expand Down Expand Up @@ -900,6 +923,7 @@
8347BB0B21F147E100E56BCD /* LDTimer.swift */,
83883DD9220B6A9A00EEAB95 /* ErrorNotifier.swift */,
8354AC742243168800CDE602 /* Cache */,
C443A4092315AA4D00145710 /* NetworkReporter.swift */,
);
path = "Service Objects";
sourceTree = "<group>";
Expand Down Expand Up @@ -1373,14 +1397,17 @@
8311886C2113AE6400D77CB5 /* ObjcLDChangedFlag.swift in Sources */,
83906A7921190B4000D7D3C5 /* FlagValueCounter.swift in Sources */,
8311884C2113ADDE00D77CB5 /* FlagChangeObserver.swift in Sources */,
C443A41223186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */,
831188592113AE1200D77CB5 /* FlagStore.swift in Sources */,
C443A40D2315AA4D00145710 /* NetworkReporter.swift in Sources */,
83906A7A21190B4E00D7D3C5 /* EventTrackingContext.swift in Sources */,
831188652113AE4600D77CB5 /* Date.swift in Sources */,
831188672113AE4D00D77CB5 /* Thread.swift in Sources */,
832D68A0224A3896005F052A /* DeprecatedCacheModelV5.swift in Sources */,
8311886D2113AE6700D77CB5 /* ObjcLDVariationValue.swift in Sources */,
8354AC642241511D00CDE602 /* CacheableEnvironmentFlags.swift in Sources */,
83D1522E224D91B90054B6D4 /* DeprecatedCacheModelV3.swift in Sources */,
C443A40823145FEE00145710 /* ConnectionInformationStore.swift in Sources */,
831188662113AE4A00D77CB5 /* AnyComparer.swift in Sources */,
831188492113ADD400D77CB5 /* LDFlagBaseTypeConvertible.swift in Sources */,
8311885C2113AE2200D77CB5 /* HTTPHeaders.swift in Sources */,
Expand All @@ -1391,6 +1418,7 @@
8311884B2113ADDA00D77CB5 /* LDChangedFlag.swift in Sources */,
8311885E2113AE2900D77CB5 /* HTTPURLResponse.swift in Sources */,
8347BB0F21F147E100E56BCD /* LDTimer.swift in Sources */,
C443A40523145FBF00145710 /* ConnectionInformation.swift in Sources */,
8354AC732243166900CDE602 /* UserEnvironmentFlagCache.swift in Sources */,
8311885B2113AE1D00D77CB5 /* Throttler.swift in Sources */,
831188612113AE3700D77CB5 /* Optional.swift in Sources */,
Expand Down Expand Up @@ -1427,12 +1455,15 @@
831EF34820655E730001C643 /* LDFlagValueConvertible.swift in Sources */,
831EF34920655E730001C643 /* LDFlagBaseTypeConvertible.swift in Sources */,
831EF34A20655E730001C643 /* FeatureFlag.swift in Sources */,
C443A40C2315AA4D00145710 /* NetworkReporter.swift in Sources */,
831EF34B20655E730001C643 /* LDChangedFlag.swift in Sources */,
8354AC722243166900CDE602 /* UserEnvironmentFlagCache.swift in Sources */,
C443A40423145FBE00145710 /* ConnectionInformation.swift in Sources */,
832D68A4224A38FC005F052A /* CacheConverter.swift in Sources */,
831EF34C20655E730001C643 /* FlagChangeObserver.swift in Sources */,
831EF34D20655E730001C643 /* FlagsUnchangedObserver.swift in Sources */,
831EF34E20655E730001C643 /* Event.swift in Sources */,
C443A41123186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */,
831EF35020655E730001C643 /* ClientServiceFactory.swift in Sources */,
831EF35120655E730001C643 /* KeyedValueCache.swift in Sources */,
831AAE2E20A9E4F600B46DBA /* Throttler.swift in Sources */,
Expand All @@ -1448,6 +1479,7 @@
831EF35B20655E730001C643 /* DarklyService.swift in Sources */,
831EF35C20655E730001C643 /* HTTPURLResponse.swift in Sources */,
8354AC6B22418C0600CDE602 /* CacheableUserEnvironmentFlags.swift in Sources */,
C443A40723145FEE00145710 /* ConnectionInformationStore.swift in Sources */,
831EF35D20655E730001C643 /* HTTPURLRequest.swift in Sources */,
831EF35E20655E730001C643 /* Dictionary.swift in Sources */,
835E4C54206BDF8D004C6E6C /* EnvironmentReporter.swift in Sources */,
Expand Down Expand Up @@ -1494,14 +1526,17 @@
8372668C20D4439600BD1088 /* DateFormatter.swift in Sources */,
83A2D6241F51CD7A00EA3BD4 /* LDUser.swift in Sources */,
8354EFE21F26380700C05156 /* Event.swift in Sources */,
C408884923033B7500420721 /* ConnectionInformation.swift in Sources */,
831D8B721F71D3E700ED65E8 /* DarklyService.swift in Sources */,
835E1D431F685AC900184DB4 /* ObjcLDChangedFlag.swift in Sources */,
8358F25E1F474E5900ECE1AF /* LDChangedFlag.swift in Sources */,
8354AC6922418C0600CDE602 /* CacheableUserEnvironmentFlags.swift in Sources */,
83D559741FD87CC9002D10C8 /* KeyedValueCache.swift in Sources */,
831AAE2C20A9E4F600B46DBA /* Throttler.swift in Sources */,
8354EFE11F26380700C05156 /* LDConfig.swift in Sources */,
C443A40F23186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */,
83F0A5621FB4D66600550A95 /* AnyComparer.swift in Sources */,
C443A40A2315AA4D00145710 /* NetworkReporter.swift in Sources */,
83EBCBA320D9A1F3003A7142 /* FlagValueCounter.swift in Sources */,
831D8B741F72994600ED65E8 /* FlagStore.swift in Sources */,
8358F2601F476AD800ECE1AF /* FlagChangeNotifier.swift in Sources */,
Expand All @@ -1518,6 +1553,7 @@
83B9A082204F6022000C3F17 /* FlagsUnchangedObserver.swift in Sources */,
8354EFE01F26380700C05156 /* LDClient.swift in Sources */,
831425B1206B030100F2EF36 /* EnvironmentReporter.swift in Sources */,
C408884723033B3600420721 /* ConnectionInformationStore.swift in Sources */,
83B6C4B61F4DE7630055351C /* LDCommon.swift in Sources */,
83EF678A1F97CFEC00403126 /* Dictionary.swift in Sources */,
8347BB0C21F147E100E56BCD /* LDTimer.swift in Sources */,
Expand Down Expand Up @@ -1622,14 +1658,17 @@
831AAE2D20A9E4F600B46DBA /* Throttler.swift in Sources */,
83EBCBA420D9A1F3003A7142 /* FlagValueCounter.swift in Sources */,
83D9EC872062DEAB004D7FA6 /* FlagSynchronizer.swift in Sources */,
C443A41023186A4F00145710 /* ConnectionModeChangeObserver.swift in Sources */,
83D9EC882062DEAB004D7FA6 /* FlagChangeNotifier.swift in Sources */,
C443A40B2315AA4D00145710 /* NetworkReporter.swift in Sources */,
83D9EC892062DEAB004D7FA6 /* EventReporter.swift in Sources */,
83D9EC8A2062DEAB004D7FA6 /* FlagStore.swift in Sources */,
83D9EC8B2062DEAB004D7FA6 /* Log.swift in Sources */,
832D689E224A3896005F052A /* DeprecatedCacheModelV5.swift in Sources */,
8354AC622241511D00CDE602 /* CacheableEnvironmentFlags.swift in Sources */,
83D9EC8C2062DEAB004D7FA6 /* HTTPHeaders.swift in Sources */,
83D1522C224D91B90054B6D4 /* DeprecatedCacheModelV3.swift in Sources */,
C443A40623145FED00145710 /* ConnectionInformationStore.swift in Sources */,
83D9EC8D2062DEAB004D7FA6 /* DarklyService.swift in Sources */,
83D9EC8E2062DEAB004D7FA6 /* HTTPURLResponse.swift in Sources */,
83D9EC8F2062DEAB004D7FA6 /* HTTPURLRequest.swift in Sources */,
Expand All @@ -1640,6 +1679,7 @@
83D9EC922062DEAB004D7FA6 /* Data.swift in Sources */,
8347BB0D21F147E100E56BCD /* LDTimer.swift in Sources */,
8354AC712243166900CDE602 /* UserEnvironmentFlagCache.swift in Sources */,
C443A40323145FB700145710 /* ConnectionInformation.swift in Sources */,
83D9EC932062DEAB004D7FA6 /* Array.swift in Sources */,
83D9EC942062DEAB004D7FA6 /* JSONSerialization.swift in Sources */,
83D9EC952062DEAB004D7FA6 /* Date.swift in Sources */,
Expand Down
30 changes: 30 additions & 0 deletions LaunchDarkly/GeneratedCode/mocks.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ final class DarklyStreamingProviderMock: DarklyStreamingProvider {
onErrorEventCallback?()
}

// MARK: onReadyStateChangedEvent
var onReadyStateChangedEventCallCount = 0
var onReadyStateChangedEventCallback: (() -> Void)?
var onReadyStateChangedEventReceivedHandler: LDEventSourceEventHandler?
func onReadyStateChangedEvent(_ handler: LDEventSourceEventHandler?) {
onReadyStateChangedEventCallCount += 1
onReadyStateChangedEventReceivedHandler = handler
onReadyStateChangedEventCallback?()
}

// MARK: open
var openCallCount = 0
var openCallback: (() -> Void)?
Expand Down Expand Up @@ -405,6 +415,16 @@ final class FlagChangeNotifyingMock: FlagChangeNotifying {
addFlagsUnchangedObserverCallback?()
}

// MARK: addConnectionModeChangedObserver
var addConnectionModeChangedObserverCallCount = 0
var addConnectionModeChangedObserverCallback: (() -> Void)?
var addConnectionModeChangedObserverReceivedObserver: ConnectionModeChangedObserver?
func addConnectionModeChangedObserver(_ observer: ConnectionModeChangedObserver) {
addConnectionModeChangedObserverCallCount += 1
addConnectionModeChangedObserverReceivedObserver = observer
addConnectionModeChangedObserverCallback?()
}

// MARK: removeObserver
var removeObserverCallCount = 0
var removeObserverCallback: (() -> Void)?
Expand All @@ -415,6 +435,16 @@ final class FlagChangeNotifyingMock: FlagChangeNotifying {
removeObserverCallback?()
}

// MARK: notifyConnectionModeChangedObservers
var notifyConnectionModeChangedObserversCallCount = 0
var notifyConnectionModeChangedObserversCallback: (() -> Void)?
var notifyConnectionModeChangedObserversReceivedConnectionMode: ConnectionInformation.ConnectionMode?
func notifyConnectionModeChangedObservers(connectionMode: ConnectionInformation.ConnectionMode) {
notifyConnectionModeChangedObserversCallCount += 1
notifyConnectionModeChangedObserversReceivedConnectionMode = connectionMode
notifyConnectionModeChangedObserversCallback?()
}

// MARK: notifyObservers
var notifyObserversCallCount = 0
var notifyObserversCallback: (() -> Void)?
Expand Down
6 changes: 1 addition & 5 deletions LaunchDarkly/LaunchDarkly/Extensions/Dictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ extension Optional where Wrapped == [String: Any] {
public static func == (lhs: [String: Any]?, rhs: [String: Any]?) -> Bool {
guard let lhs = lhs
else {
guard let _ = rhs
else {
return true
}
return false
return rhs == nil
}
guard let rhs = rhs
else {
Expand Down
Loading

0 comments on commit 95114f0

Please sign in to comment.