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

Bugsnag.featureFlags() returning nil #1487

Closed
rebello95 opened this issue Sep 21, 2022 · 1 comment
Closed

Bugsnag.featureFlags() returning nil #1487

rebello95 opened this issue Sep 21, 2022 · 1 comment

Comments

@rebello95
Copy link

rebello95 commented Sep 21, 2022

Bugsnag.featureFlags() consistently returns nil, even after calling Bugsnag.start() and Bugsnag.addFeatureFlag(...).

This appeared when upgrading from 6.22.1 to 6.23.1. I noticed that #1481 heavily modified this codepath.

Environment

  • Bugsnag version: 6.23.1
  • iOS version: 16.0
  • Simulator or physical device: iPhone 14 simulator
  • Xcode version: 14.0

Current configuration:

let configuration = BugsnagConfiguration(kBugsnagKey)
configuration.enabledBreadcrumbTypes = []
configuration.autoTrackSessions = true
configuration.sendLaunchCrashesSynchronously = true
configuration.launchDurationMillis = 0
configuration.maxBreadcrumbs = 100
configuration.releaseStage = "..."
configuration.enabledErrorTypes.ooms = true
configuration.enabledErrorTypes.appHangs = true
configuration.appHangThresholdMillis = 2000
configuration.enabledErrorTypes.thermalKills = true
configuration.addOnSendError { ... }

Steps

Call Bugsnag.start()
Call Bugsnag.addFeatureFlag(...)
Call Bugsnag.featureFlags(). It should return flags that were previously set, but instead returns nil

This was the test that we have which caught this:

func testGetFeatureFlagsInternalApiAccessor() {
    let bugsnag = BugsnagWrapper() // Simple shim to Bugsnag
    bugsnag.start(onSendError: { _ in true })
    bugsnag.addFeatureFlag(key: "testKey", value: "testValue")
    XCTAssertEqual(bugsnag.featureFlags(), [BugsnagFeatureFlag(name: "testKey", variant: "testValue")])
}
@rebello95
Copy link
Author

Looks like this is actually an in-house extension that relied on private APIs that changed in the linked PR. Please disregard 😓

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

1 participant