Skip to content

Commit

Permalink
Prepare 4.3.2 release (#204)
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

* [4.2.1] - 2019-11-15 (#81)

* Added 4.2.1 changes including Dictionary fix and test and eventsource version bump

* Added Carthage build files

* Added attribution to CHANGELOG

* Evaluation Reasons (#82)

* Initial Evaluation Reasons prototype

* Changed evaluationReasons to reasons, fixed mangled question mark in url query parameters

* Added errorKinds

* Added reason to debug events

* Changed reason nil handling in events

* Removed unnecessary private functions, removed event nil coalesce

* Event change for reason nil

* Removed if in Event for reason nil, added guard let NSNull for dictionary in Events

* Added reason null to normal variation calls

* Testing alternate reason null set

* Change Event comparison code to add reason

* Removed reason from event dictionary matches

* Removed Event Equatable reason and changed Event Dictionary matches

* Explicitly set featureflag reason property to nil when not send feature event for variationDetail

* Fixed DeprecatedCacheModel unit tests, added v6 model tests, added variation detail unit tests, changed event reason nil check

* Added variationDetail to objective c, fixed cache converter unit tests, deprecated variationAndSource

* Added new files to correct target membership

* Simplify featureflag reason nil check

* Removed unnecessary comments, deprecated objc variationAndSource

* Improved doc strings, cut down on variation doc string repetition, added reason tests for Event and EventReporter, added EvaluationDetail generic

* Added ObjCEvaluationDetail to correct target membership

* Differentiated objc evaluation detail return type, change reason constant in unit tests

* Removed Optional value on fallback variation

* Added Event test for reason false but flag reason present, cleaned up objc doc strings, changed optional types in objc evaluation detail

* Experimentation 1.5 (#83)

* Added trackReasons and metricValue as well as doc and unit tests

* Added unit tests for reason false track reason true, added objc track without metricValue, changed and trackReason to or trackReason

* Added explicit event store reason test

* Fixed objc track comment

* Updated reason to includeReason for clarity

* Explicitly check both feature and debug events

* Prepare version 4.3.0

* Update ios-eventsource to 4.1.0 (#84)

* Updated ios-eventsource to 4.1.0, updated version strings

* Added sentence about iOS SDK compat to CHANGELOG

* pod repo update to get new eventsource version

* Fixed change listener not firing when only value changes (#85)

* Fixed change listener not firing when only value changes

* Fixed a unit test variable name typo

* Cast flag value to dictionary instead of string, improved unit test

* Remove debug printout, remove unnecessary parameter

* Updated CHANGELOG, README, and podspec for 4.3.2

Co-authored-by: Mark Pokorny <[email protected]>
  • Loading branch information
torchhound and markpokornycos authored Dec 20, 2019
1 parent 450b427 commit 0c31da2
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ 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.3.2] - 2019-12-19
### Fixed
- Flag change listeners will now be called when a flag value changes but a variation number does not change. Previously, flag listeners were not called when a value assigned to a variation was manually edited in the dashboard or via the API.

## [4.3.1] - 2019-12-12
### Changed
- Updated to `ios-eventsource` version `4.1.0`. This negates the need to `use_frameworks!` when using the React Native SDK. This change does not affect the iOS SDK.
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.3.1"
ld.version = "4.3.2"
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.3.1'}
ld.source = { :git => "https://github.com/launchdarkly/ios-client-sdk.git", :tag => '4.3.2'}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ final class FlagChangeNotifier: FlagChangeNotifying {
else {
return true
}
return !oldFeatureFlag.matchesVariation(newFeatureFlag)
return !(oldFeatureFlag.matchesVariation(newFeatureFlag) && ["value": oldFeatureFlag.value as Any] == ["value": newFeatureFlag.value as Any])
}
}
}
Expand Down
16 changes: 15 additions & 1 deletion LaunchDarkly/LaunchDarklyTests/Mocks/DarklyServiceMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ final class DarklyServiceMock: DarklyServiceProvider {
includeVariations: Bool = true,
includeVersions: Bool = true,
includeFlagVersions: Bool = true,
alternateVariationNumber: Bool = true,
bumpFlagVersions: Bool = false,
alternateValuesForKeys alternateValueKeys: [LDFlagKey] = [],
eventTrackingContext: EventTrackingContext? = EventTrackingContext.stub()) -> [LDFlagKey: FeatureFlag] {

Expand All @@ -121,6 +123,9 @@ final class DarklyServiceMock: DarklyServiceProvider {
includeVersion: includeVersions,
includeFlagVersion: includeFlagVersions,
useAlternateValue: useAlternateValue(for: flagKey, alternateValueKeys: alternateValueKeys),
useAlternateVersion: bumpFlagVersions && useAlternateValue(for: flagKey, alternateValueKeys: alternateValueKeys),
useAlternateFlagVersion: bumpFlagVersions && useAlternateValue(for: flagKey, alternateValueKeys: alternateValueKeys),
useAlternateVariationNumber: alternateVariationNumber,
eventTrackingContext: eventTrackingContext))
}

Expand Down Expand Up @@ -151,6 +156,14 @@ final class DarklyServiceMock: DarklyServiceProvider {
return useAlternateValue ? variation + 1 : variation
}

private static func variation(for flagKey: LDFlagKey, includeVariation: Bool) -> Int? {
guard includeVariation
else {
return nil
}
return variation
}

private static func version(for flagKey: LDFlagKey, includeVersion: Bool, alternateValueKeys: [LDFlagKey]) -> Int? {
return version(for: flagKey, includeVersion: includeVersion, useAlternateVersion: useAlternateValue(for: flagKey, alternateValueKeys: alternateValueKeys))
}
Expand Down Expand Up @@ -183,12 +196,13 @@ final class DarklyServiceMock: DarklyServiceProvider {
useAlternateValue: Bool = false,
useAlternateVersion: Bool = false,
useAlternateFlagVersion: Bool = false,
useAlternateVariationNumber: Bool = true,
eventTrackingContext: EventTrackingContext? = EventTrackingContext.stub(),
includeEvaluationReason: Bool = false,
includeTrackReason: Bool = false) -> FeatureFlag {
return FeatureFlag(flagKey: flagKey,
value: value(for: flagKey, useAlternateValue: useAlternateValue),
variation: variation(for: flagKey, includeVariation: includeVariation, useAlternateValue: useAlternateValue),
variation: useAlternateVariationNumber ? variation(for: flagKey, includeVariation: includeVariation, useAlternateValue: useAlternateValue) : variation(for: flagKey, includeVariation: includeVariation),
version: version(for: flagKey, includeVersion: includeVersion, useAlternateVersion: useAlternateValue || useAlternateVersion),
flagVersion: flagVersion(for: flagKey, includeFlagVersion: includeFlagVersion, useAlternateFlagVersion: useAlternateValue || useAlternateFlagVersion),
eventTrackingContext: eventTrackingContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,39 @@ final class FlagChangeNotifierSpec: QuickSpec {

expect(testContext.flagChangeHandlerCallCount) == 1
expect(testContext.changedFlag) == targetChangedFlag
let newValue = testContext.changedFlag?.newValue as? String
let newValueFromChangedFlag = targetChangedFlag?.newValue as? String
if newValue != nil || newValueFromChangedFlag != nil {
expect(newValue) == newValueFromChangedFlag
}
expect(testContext.flagsUnchangedHandlerCallCount) == 0
}
}
it("activates the change handler when the value changes but not the variation number") {
DarklyServiceMock.FlagKeys.flagsWithAnAlternateValue.forEach { (key) in
testContext = TestContext(
keys: DarklyServiceMock.FlagKeys.knownFlags,
flagChangeHandler: { (changedFlag) in
testContext.flagChangeHandlerCallCount += 1
testContext.changedFlag = changedFlag
},
flagsUnchangedHandler: {
testContext.flagsUnchangedHandlerCallCount += 1
})
oldFlags = DarklyServiceMock.Constants.stubFeatureFlags(alternateVariationNumber: false, bumpFlagVersions: true, alternateValuesForKeys: [key])
targetChangedFlag = LDChangedFlag.stub(key: key, oldFlags: oldFlags, newFlags: testContext.user.flagStore.featureFlags)

waitUntil { done in
testContext.subject.notifyObservers(user: testContext.user, oldFlags: oldFlags, oldFlagSource: .server, completion: done)
}

expect(testContext.flagChangeHandlerCallCount) == 1
expect(testContext.changedFlag) == targetChangedFlag
let newValue = testContext.changedFlag?.newValue as? String
let newValueFromChangedFlag = targetChangedFlag?.newValue as? String
if newValue != nil || newValueFromChangedFlag != nil {
expect(newValue) == newValueFromChangedFlag
}
expect(testContext.flagsUnchangedHandlerCallCount) == 0
}
}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $ gem install cocoapods
```ruby
use_frameworks!
target 'YourTargetName' do
pod 'LaunchDarkly', '4.3.1'
pod 'LaunchDarkly', '4.3.2'
end
```

Expand Down Expand Up @@ -70,7 +70,7 @@ $ brew install carthage
To integrate LaunchDarkly into your Xcode project using Carthage, specify it in your `Cartfile`:

```ogdl
github "launchdarkly/ios-client-sdk" "4.3.1"
github "launchdarkly/ios-client-sdk" "4.3.2"
```

Run `carthage update` to build the framework. Optionally, specify the `--platform` to build only the frameworks that support your platform(s).
Expand Down

0 comments on commit 0c31da2

Please sign in to comment.