Skip to content

Commit

Permalink
if a flag is changed before the application reconnects, that change i…
Browse files Browse the repository at this point in the history
…s not reflected.
  • Loading branch information
Bohdan-Kim committed May 17, 2024
1 parent f809d8e commit 57420e5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/src/main/java/growthbook/sdk/java/GBFeaturesRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.ArrayList;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

/**
* This class can be created with its `builder()` or constructor.
Expand Down Expand Up @@ -256,7 +257,18 @@ public void onFeaturesResponse(String featuresJsonResponse) throws FeatureFetchE
public void onFailure(@NotNull EventSource eventSource, @Nullable Throwable t, @Nullable Response response) {
super.onFailure(eventSource, t, response);
if (retryOnFailure) {
createEventSourceListenerAndStartListening(retryOnFailure);
createEventSourceListenerAndStartListening(true);

try {
fetchFeatures();
} catch (FeatureFetchException featureFetchException) {
Logger.getAnonymousLogger()
.throwing(
"GBFeaturesRepository",
"createEventSourceListenerAndStartListening()",
featureFetchException
);
}
}
}
};
Expand Down

0 comments on commit 57420e5

Please sign in to comment.