Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No known class method for selector 'eventSourceWithURL:httpHeaders:connectMethod:connectBody:' #129

Closed
mikeono opened this issue Mar 26, 2018 · 4 comments
Assignees

Comments

@mikeono
Copy link

mikeono commented Mar 26, 2018

STEPS TO REPRO:

  1. Install 2.11.0 into an iOS app by adding the following line to your pod file:
    pod 'LaunchDarkly', :git => 'https://github.com/launchdarkly/ios-client.git', :tag => '2.11.0'

  2. Run pod install

  3. Build

  4. Compiler will complain with:

LDClientManager.m:162:38: No known class method for selector 'eventSourceWithURL:httpHeaders:connectMethod:connectBody:'

@mikeono
Copy link
Author

mikeono commented Mar 26, 2018

@markpokornycos This may be related to 4c921d9

@arun251 arun251 assigned arun251 and markpokornycos and unassigned arun251 Mar 26, 2018
@markpokornycos
Copy link
Contributor

markpokornycos commented Mar 26, 2018

@mikeono Thanks for pointing this out! I will work on resolving this into a new version. In the mean time there is a work-around. You should be able to modify your podfile to add the dependency to the DarklyEventSource version needed:

    pod 'DarklyEventSource', '3.2.0'

This should go within each target that refers to the 'LaunchDarkly' pod

@markpokornycos
Copy link
Contributor

@arun251
Copy link

arun251 commented Mar 27, 2018

Hi @mikeono, thanks for reporting the issue. We've released a fix in iOS SDK 2.11.1.

@arun251 arun251 closed this as completed Mar 27, 2018
gwhelanLD pushed a commit that referenced this issue Feb 26, 2021
torchhound added a commit that referenced this issue Apr 7, 2021
* 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

* Adds startAwaitingFlags function (#86)

* Added newStart function, updated README, podspec, and CHANGELOG

* Changed newStart to startAwaitingFlags

* Added doc strings for startAwaitingFlags and deprecated start

* Added cocoapods lib lint flag to ignore depracted API usage in ObjCLDClient, added startAwaitingFlags to ObjC

* Fixed alow to allow, changed startAwaitFlags to startCompleteWhenFlagsReceived, added unit tests for startCompleteWhenFlagsReceived

* Updated deprecation message to startCompleteWhenFlagsReceived

* [ch61092] Add X-LaunchDarkly-Payload-ID to event request headers (#87)

* Added X-LaunchDarkly-Payload-ID header to event request headers, add string length check on LD payload ID header in header unit tests

* Added CHANGELOG Added entry for event request header

* Added UUID generation to DarklyService so it's regenerated on each request

* Change CHANGELOG entry for new header to match other SDKs

* Added single retry attempt to event post (#88)

* Added single retry attempt to event post

* Added payloadId to the correct point to maintain value between retries, retry on error

* reportSyncComplete on 2nd error, always log on event post error, add 1 second delay with log on event post retry

* Added 1 second delay to retry event post

* async'd event post to prevent blocking main thread on retry sleep

* Increased event test waitUntil timeout to 10 seconds

* Bumped patch version, added CHANGELOG for 4.4.1

* Changed 4.4.1 entry

* Further 4.4.1 entry revision

* Changed retry event post for loop to function call (#89)

* [ch65670] Fix Xcode 11.4 build and unit tests (#90)

* Fixed build errors, fixed some unit tests

* Added shell script to remove duplicate sourcery method mock

* sed now matches specific pattern instead of line numbers

* Add project config file containing run script step

* Bump CircleCI Xcode to 11.4

* Bump CircleCI Xcode to 11.4.0

* Changed iPhone simulator in CircleCI from XS to Xs

* Changed CircleCI xcodebuild from OS:latest to OS:12.4

* Testing NSURLRetryPolicy on CI

* Removed DeprecatedCache from automock

* Fix FlagStore to synchronize reads with writes.

* multi env: init, config, client methods, and ObjCLDClient

* Remove accidentally checked in IDE file

* Add xcode compatibility information to readme (#93)

* Add xcode compatibility information to readme (#93)

* Fixed comments, added flush to close, started migrating unit tests

* Added multi environment methods to ObjCLDClient, added better comments for said methods

* Changed init completion behavior for correct ordering, removed deprecated variationAndSource methods, more unit test changes

* Added primary instance to instances, fixed completion behavior

* Made UserEnvironmentFlagCache shared between instances, made FlagSynchronizer DispatchQueue not static

* Fixed user clobbering by deep copying FlagStore

* Fix for concurrency bug exposed by restwrapper. (#94)

* General cleanup. (#92)

* [ch75316] Added maxCachedUsers to LDConfig and UserEnvironmentFlagCache (#96)

* Added maxCachedUsers to LDConfig and UserEnvironmentFlagCache

* Changed specific -1 to 0

* Added unlimited users tests

* Added CHANGELOG for 4.6

* Added maxCachedUsers to objc LDConfig (#97)

* Changed version to 4.6.0

* [ch66864] Added startCompleteWhenFlagsReceivedTimeout (#98)

* Added startCompleteWhenFlagsReceivedTimeout which allows a timeout in seconds to be given for the completion to be fired indicating that flags have been received

* Fixed doc typo, removed bad ms to second conversion

* Fix previous doc typo that got copied into objc

* Added serial queue to timeOutCheck to fix possible race condition

* Simplified unit tests by swapping if for assertion

* Simplified start timeout method name, fixed doc about timedOut return

* Moved DispatchQueue off of main

* Moved sync dispatchqueue from variable to func

* Changed labeled queue to global queue

* Added test for start timeout timing out, added doc note about start timeout and starting offline

* [ch70792] Swift EventSource (#99)

* Integrating Swift eventsource.

* No longer set `-sdk` on `xcodebuild` commands for circle. There seems
to be some sort of interaction between `-sdk` or `SDKROOT` and the
implicit dependency resolution system. Since Xcode 10.2, Xcode can
find implicit dependencies in `OTHER_LINKER_FLAGS` such as when
Cocoapods links a framework with `-F`. When `SDKROOT` is not set, this
doesn't conflict with anything, but I believe the behavior of finding
the framework as an implicit dependency is not required (I think it
just resolves to the same target Cocoapods is building). If `SDKROOT`
is set, xcodebuild seems to decide that it must first resolve and
build the framework. It gives the warning "Multiple targets match
implicit dependency for linker flags '-framework LDSwiftEventSource'",
as LDSwiftEventSource generates a product by the same name
(`LDSwiftEventSource.framework`) regardless of the platform/sdk being
built. Now apparently it completely forgets about the set `SDKROOT`
(which normally seems to be fed through and used to resolve the target
being built) and decides that it should build the iOS target (no idea
why, it's not even the default `SDKROOT` for
`LDSwiftEventSource`). When `SDKROOT` is set to `macosx`, `xcodebuild`
proceeds to simultaneously build both the iOS and macOS targets (I
believe the macOS target is from Cocoapods operating correctly), then
fails as it's still actually building the iOS target with the macOS
SDK configuration. The actual build error is that the
'LDSwiftEventSource-iOS-umbrella.h' header can't find 'UIKit/UIKit.h'
as UIKit is not available on macOS.

* Update LDSwiftEventSource to 0.3.0, handle some minor todos.

* This updates the circle config to actually do a `pod install`. Removes
Gemfile that was for CocoaPods.

* Specify sources for pod spec lint.

* I think spec lint tries to test the spec file against code on the
master branch, so only run a spec lint if commit is on master.

* Allow warnings for now.

* Bump version to 4.7.0 and add CHANGELOG

* Changed startWaitSeconds type signature from Int to TimeInterval

* Changed startWaitSeconds doc string type to TimeInterval

* Clarified 4.7.0 CHANGELOG

* Fixed no log output when isDebugMode = true

* Fixed old EventSource still sticking around, removed default to fix compiler warning

* Added startWaitSeconds to start, added more debug logging, added flagsynchronizer config.streamingMode

* Fixed LDClient offline by putting internalIdentify in an async DispatchQueue, removed print statements

* Unit tests build but LDClientSpec crashes

* [ch72204] drop events after failed retry (#100)

* Drop events after failed retry, as well as some general cleanup and
consistency changes.

* Don't disabled event reporting in background.

* Added ClientServiceFactory back to init

* Throttler mock isn't firing, migrating unit tests to TestContext init pattern

* [ch61747] Diagnostic events (#101)

* Start specs build and run but fail

* Removed public set LDClient.config, added more failing specs, removed prints

* Removed convenience init flagSynchronizer set to avoid malloc error, all but 2 LDClient specs build and run

* All LDClient specs build and run

* Fixed LDClient spec flagstore mock being replaced

* Remove EventTrackingContext

* Added config didSet back to init, removed outdated tests

* Removed outdated tests for client not started, fixed some incorrectly ported tests

* Fix more LDClient unit tests failures

* Remove EventTrackingContext (#102)

* Remove DeprecatedCacheModelV6, which was never needed.

* A bit of cleanup.

* Update some old comments.

* Update diagnostic events to include count of secondary mobile keys.

* Added waitUntil to internalIdentify calls to fix timing issue in some tests

* Added setOnline for background tests, removed unnecessary runMode parameter on test start

* set hasStarted false for starting tests

* Fixed static timeOutCheck not being reset, trigger service didSet for pollingInterval tests

* Added secondaryMobileKeys to ObjCLDConfig, change Array<String>? to [String]?, changed getEnvNames return, removed unnecessary returns in ClientServiceFactory, changed to internalSetOnline in close

* Set instances to nil after loop in close

* Remove UUID queue labels

* Forgot empty FlagStore init

* Added waitUntil to identify to fix Circle timing

* Only internal ObjC methods can set the ObjCLDClient.ldClient

* Moved all internalIdentify calls to waitUntil to fix Circle timing

* Make config public private(set)

* Added debug method to set config allUserAttributesPrivate

* Make testing allUserAttributesPrivate method public

* Move setAllUserAttributesPrivate to public

* Attempted timing fix for Circle

* Lowered timeout with troublesome test

* Troublesome test false to true

* Try synchronized instead of DispatchQueue.sync

* Change sync queue and if ordering in start timeout

* Forgot to add to testing version

* Removed spurious changes from FlagSynchronizer and FlagStore

* Try synced with if change start timeout

* Changed setAllUserAttributesPrivate to apply to all instances, changed setOnline to internalSetOnline in configDidSet

* Changed LDClient internal setOnline calls to internalSetOnline

* Removed synced, added serial queues to identify and setonline

* Removed true check in start timeout

* Test removing serial queue from setOnline and identify

* Change serial queues in setOnline and identify to sync

* Move if outside sync serial queue in start timeout

* Move if back inside serial queue but make queue async start timeout

* remove static from internal method queues

* Add secondaryMobileKeys to convertCacheData

* Switched global to main queue in start timeout

* Try name queue instead of main in start timeout

* Remove internalIdentifyQueue

* Changed named queue back to global, added back InternalIdentifyQueue, changed CircleCi simulator from iOS 12.4 to 13.4

* Change iOS 13.4 to 13.4.1 in Circle

* Change iOS simulator from Xs to iPhone 11 Pro Max

* Updating to iOS 13.4.1 on Circle fix disparity between DarklyServiceSpec on local vs Circle

* Removed static from timeOutCheck and queue and made them function scope variables

* Made main queues named queues in LDClientSpec

* Explicitly turn off parallel testing on Circle

* Added waitUntil with asyncAfter to setRunMode and background notification

* Changed all asyncAfter deadlines to 0.2

* Passes thread sanitizer locally

* More thread sanitizer finds

* Fixed recursive sync queues in EventReporter and FlagSynchronizer

* Improve Throttler code.

* Hopefully fix sync queue crash in FlagChangeNotifier.

* I don't think we actually want to loop through converting all
environment cache data here.

* changed internalIdentifyQueue to sync, added sync queue to internalSetOnline

* PR feedback, removed convenience init

* Fixed onSuccess tests

* Removes isStarting variable, to make initialization more clear.

* Removes all remaining LDFlagSource code.

* Fix logging of type conversion errors.

* Update more code doc for multi-environment branch changes.

* Remove unnecessary objc class and improve interface for type
mismatches on changed flag handlers.

* Prefer `is` to `as != nil`.

* Use DispatchGroup for static loops.

* Make time constraint a bit more lenient for more reliable CircleCI
tests.

* Add a threshold for testing delay on throttler executions to prevent
spurious test failures.

* Replaced timeOutCheck with completed, simplified start test close, removed unnecessary string cast in LDConfig

* Removed unnecessary nil check in start for tests

* Removed unnecessary string cast in LDConfig, made waitUntil longer than start timeout

* Fix after merge.

* Change setUserSpec to identifySpec, fix doc strings

* Remove internalInstances from LDClient, remove isOnlineQueue from DiagnosticReporter

* Should improve LDClientSpec test runtime substantially.

* 3 second for timeout seems a bit long even for circleci.

* Update OHHTTPStubs for SwiftPM support.

* Update DarklyServiceMock for changes in OHHTTPStubs 9.0.0

* Update DarklyServiceSpec for OHHTTPStubs 9.0.0

* Add explicit import for Foundation in tests. Make linter slightly more
lienent and specify linted paths better. Fix mocks.stencil to allow
specifying a defaultMockValue for an Optional type variable. Change
default value for EnvironmentReporting.backgroundNotification and
EnvironmentReporting.foregroundNotification to delegate to
EnvironmentReporter to handle running tests on platforms without
UIKit. Avoid using XCTFail.

* Add initial SwiftPM Package.swift definition. Add SwiftPM build folder
to .gitignore. Add missing Foundation import in
LDClientSpec.swift. Comment out test that was previously disabled in
the xcode test configuration, which SwiftPM doesn't use.

* Use github reference for LDSwiftEventSource rather than local
reference.

* Try specifying ssh urls for dependencies in Package.swift as xcode is
choking when adding the package.

* Remove setAllUserAttributesPrivate public method

* Changed ObjcLDClient to act as a wrapper instead of keeping an internal LDClient, updated doc strings

* Fixed weird setOnline tests, fixed doc strings, added throws setter to secondaryMobileKeys, fixed ObjcLDClient

* Fixed LDClient close tests, added getter setter doc strings for secondaryMobileKeys, removed commented out code in LDConfig, removed unnecessary setOnline method in ObjcLDClient

* Fix doc strings in LDClient

* Removed logs from throws in LDConfig

* Added .swiftpm/ to .gitignore, removed all occurrences of fallback and replaced them with defaultValue (#111)

* Added .swiftpm/ to .gitignore, removed all occurrences of fallback and replaced them with defaultValue

* Change .swiftpm/ to /.swiftpm

* Removed defaultValue value

* Fix 2 typos

* Updated SDK version and supported iOS and Xcode versions in README

* Use Mint for tooling.

* Update CONTRIBUTING.md

Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>

* Add @objc annotation to start objc bridge methods.

* (5.0) Use SwiftPM for SDK dependencies. (#114)

* (5.0) Fix of crash when logging is enabled. (#115)

Also removed unused test code. Improve documentation on LDClient.flush()

* (5.0) Update installation instructions (#116)

* (5.0) Changelog and some final removals and renames of public APIs (#117)

Fix a bug with preventing the SDK from retrying eventsource connections when the service returns a 5XX error code. Renamed a couple of public APIs. Removed some publicly exposed implementation details. Updated CHANGELOG.md for 5.0.

* [ch69438] Add ability to set additional headers on requests (#119)

* A jazzy doc build and update lint configuration (#120)

* [ch84954] Fix nested bundles in carthage build and missing dynamic library in SwiftPM build. (#121)

* Focus week cleanup (#122)

* [ch87108] Fix LDUser serialization to report redacted custom attributes in all cases (#123)

* [ch87107] Add LDUser secondary attribute (#124)

* [ch88282] Fix DiagnosticEvent build warnings on Xcode 12 (#125)

* Update dependencies after release of Nimble 9.0.0 (#126)

* Update doc comments for LDClient.identify (#127)

* [ch91505] Dynamic header configuration (#128)

Allow dynamic configuration of http headers through LDConfig.headerDelegate

* [ch94946] Multi Environment Bug Fix: Decouple FlagStore from LDUser (#130)

* Removed FlagStore from LDUser

* All unit tests build and LDClientSpec doesn't crash

* Fixed 1 unit test, removed unnecessary testing parameter in internalIdentify

* Fixed 29 unit tests

* Fixed 26 unit tests

* Fix all but 4 unit tests

* Removed comment

* Addressed PR feedback

* Removed unnecessary for each in LDUserSpec

* Removed unnecessary contexts in LDUserSpec, removed user value in FlagChangeNotifierSpec

* Fixed LDUserSpec context, added stub flags to DarklyServiceSpec

* Make LDClientSpec init less hacky

* Clear FlagStore if new user does not have cached flags, make flagStore a let

* Added FlagStore back to LDUser for init from flag dictionary, check for user.flagStore on LDClient init and identify

* Added deprecation comment to dictionary init for LDUser, prioritize LDUser FlagStore over cache in identify

* Changed identify ordering back to cache over flagstore, made FlagStore a let

* Bump version and CHANGELOG for 5.3.1

* Removed the guides link

* Added sync queue boolean check on go completion (#131)

* Update LDSwiftEventSource dependency (#132)

* Correlate anonymous users (#129)

* Clean up mock generation. (#133)

* Remove extraneous comments. (#134)

* Remove extraneous code for removing flag change observers (#135)

* Non-nilable flags unchanged handler (#136)

* Remove redundant args from LDClientSpec TestContext init calls (#137)

* Delegate FlagMaintainingMock to FlagStore. (#138)

* Remove redundant tests in LDClientSpec. (#139)

* Clean up onSyncCompleteErrorSpec. (#140)

* Separate transition to background tests from start tests. (#141)

* Clean up observeSpec. (#142)

* Improve allFlags spec. (#143)

* Remove unused variation function of FlagStore. (#144)

* Make service in LDClient immutable. (#145)

* [ch98013] Rework the diagnostic reporter and add tests. (#146)

* [ch61000] Add `isInitialized` method to the public API (#147)

* Added isInitialized method and unit tests

* Fix unit tests, stop double testContext.start

* PR feedback

* Remove returns doc

* Avoid sending contextKind for non-anonymous users in feature and custom events. (#148)

* Make `isInitialized` a property rather than a method. (#149)

* Simplify Event Reporter (#150)

* Cleanup flag store spec (#151)

* Cleanup cache tests. (#152)

* Added resetTimer to Throttler (#153)

* Added resetTimer to Throttler

* Fix race condition in access and then decrement/increment of runAttempts

* PR feedback

* Avoid potential issue with timer lifecycle.

Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>

* Prepare 5.4.1 patch release

Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Elliot <35050275+Apache-HB@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants