Skip to content

fix: Prevent allFlagsState from throwing when retrieving flags fails - #294

Merged
keelerm84 merged 1 commit into
mainfrom
mk/SDK-3518/all-flags-state-errors
Nov 10, 2026
Merged

keelerm84 merged 1 commit into
mainfrom
mk/SDK-3518/all-flags-state-errors

Conversation

@keelerm84

@keelerm84 keelerm84 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Summary

LDClient::allFlagsState() only caught UnrecoverableHTTPStatusException from the feature requester. Any other error, such as a network failure, a persistent store failure, or an exception from a custom FeatureRequester, escaped to the caller. Evaluation methods should not throw, and other SDKs return an invalid state here.

allFlagsState() now catches any Throwable from getAllFeatures(), logs it at error level, and returns an invalid FeatureFlagsState. Unrecoverable HTTP errors still take the client offline.


Note

Overview
LDClient::allFlagsState() no longer lets failures from FeatureRequester::getAllFeatures() bubble up. Besides UnrecoverableHTTPStatusException (still puts the client offline), it now catches any Throwable, logs via Util::logExceptionAtErrorLevel, and returns an invalid FeatureFlagsState, matching single-flag evaluation and other SDKs.

Tests cover RuntimeException / Error (invalid state, empty map, error log, client stays online) and unrecoverable HTTP on allFlagsState (client offline on later calls).

Reviewed by Cursor Bugbot for commit d57af57. Bugbot is set up for automated code reviews on this repo. Configure here.

@keelerm84
keelerm84 marked this pull request as ready for review November 9, 2026 18:16
@keelerm84
keelerm84 requested a review from a team as a code owner November 9, 2026 18:16
@keelerm84
keelerm84 requested a review from kinyoklion November 9, 2026 20:33
@keelerm84
keelerm84 merged commit 2b65bf2 into main Nov 10, 2026
18 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3518/all-flags-state-errors branch November 10, 2026 15:45
keelerm84 pushed a commit that referenced this pull request Nov 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.12.1](6.12.0...6.12.1)
(2026-11-10)


### Bug Fixes

* Include the big segments status on evaluation reasons for failed
evaluations
([#292](#292))
([2f2b1fe](2f2b1fe))
* Include the HTTP status in exceptions on evaluation reasons
([#291](#291))
([52d3303](52d3303))
* Make TestData valueForAll return its value when targeting is off
([#288](#288))
([b8a9522](b8a9522))
* Prevent allFlagsState from throwing when retrieving flags fails
([#294](#294))
([2b65bf2](2b65bf2))

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

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.

2 participants