Skip to content

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Jan 8, 2026

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

SDK-1736

Describe the solution you've provided

  • When we call variation on a non-existent flag, we now should only get a warning message and the default flag value will be returned
  • We will no longer emit an error to the client side emitter, but we will still return an error detail as well as send an error event to LD

Additional context

This behavior should now be consistent with what we have in v3 (https://github.com/launchdarkly/js-sdk-common/blob/main/src/index.js#L339). The reason for this change is that there is a valid chance that a missing flag is not considered a "error" level event on the application as developers can handle these cases with defaults (and more specialized handling by looking at the variation detail).


Note

Aligns unknown-flag behavior with v3 by de-escalating from client error events to warnings.

  • In LDClientImpl._variationInternal, replace emitter error with logger.warn for unknown flags; still send unknownFlagEvent and return createErrorEvaluationDetail(FLAG_NOT_FOUND, ...).
  • Update tests in LDClientImpl.variation.test.ts to expect a warning and default value for variation, and an error detail for variationDetail.

Written by Cursor Bugbot for commit a960a00. This will update automatically on new commits. Configure here.

@joker23 joker23 requested a review from a team as a code owner January 8, 2026 21:32
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23337 bytes
Compressed size limit: 25000
Uncompressed size: 81335 bytes

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 171189 bytes
Compressed size limit: 200000
Uncompressed size: 798447 bytes

@joker23 joker23 force-pushed the skz/sdk-1736/client-sdk-logging branch from eb93600 to a960a00 Compare January 8, 2026 21:36
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19354 bytes
Compressed size limit: 20000
Uncompressed size: 99752 bytes

@joker23 joker23 merged commit f87b418 into main Jan 8, 2026
37 checks passed
@joker23 joker23 deleted the skz/sdk-1736/client-sdk-logging branch January 8, 2026 23:16
@github-actions github-actions bot mentioned this pull request Jan 8, 2026
joker23 pushed a commit that referenced this pull request Jan 9, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>browser: 0.1.1</summary>

##
[0.1.1](browser-v0.1.0...browser-v0.1.1)
(2026-01-08)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk bumped from 0.12.0 to 0.12.1
</details>

<details><summary>browser-telemetry: 1.0.17</summary>

##
[1.0.17](browser-telemetry-v1.0.16...browser-telemetry-v1.0.17)
(2026-01-08)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-client-sdk bumped from 0.12.0 to 0.12.1
</details>

<details><summary>jest: 0.2.1</summary>

##
[0.2.1](jest-v0.2.0...jest-v0.2.1)
(2026-01-08)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.12.4 to ~10.12.5
</details>

<details><summary>js-client-sdk: 0.12.1</summary>

##
[0.12.1](js-client-sdk-v0.12.0...js-client-sdk-v0.12.1)
(2026-01-08)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.17.0 to 1.17.1
</details>

<details><summary>js-client-sdk-common: 1.17.1</summary>

##
[1.17.1](js-client-sdk-common-v1.17.0...js-client-sdk-common-v1.17.1)
(2026-01-08)


### Bug Fixes

* browser logging for non-existing flags
([#1054](#1054))
([f87b418](f87b418))
</details>

<details><summary>react-native-client-sdk: 10.12.5</summary>

##
[10.12.5](react-native-client-sdk-v10.12.4...react-native-client-sdk-v10.12.5)
(2026-01-08)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.17.0 to 1.17.1
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Release summary**
> 
> - Bumps `@launchdarkly/js-client-sdk` to `0.12.1`,
`@launchdarkly/browser` to `0.1.1`,
`@launchdarkly/react-native-client-sdk` to `10.12.5`,
`@launchdarkly/js-client-sdk-common` to `1.17.1`,
`@launchdarkly/browser-telemetry` to `1.0.17`, and `@launchdarkly/jest`
to `0.2.1` (manifest and changelogs updated)
> - Updates inter-package dependencies to these versions and refreshes
in-code version constants in `BrowserInfo.ts` and `PlatformInfo.ts`
> - Includes bug fix from `@launchdarkly/[email protected]`:
browser logging for non-existing flags
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
43273ab. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@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

Successfully merging this pull request may close these issues.

3 participants