Skip to content

Commit 3faa75b

Browse files
committed
Fixes
1 parent 8f55b66 commit 3faa75b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/main/java/io/split/android/client/service/splits/OutdatedSplitProxyHandler.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import io.split.android.client.utils.logger.Logger;
1212

1313
/**
14-
* Handles proxy spec fallback and recovery for Split SDK.
14+
* Handles proxy spec fallback and recovery.
1515
*
1616
* <p>This class manages the state machine that determines which spec version (latest or legacy) should be used
1717
* to communicate with the Split Proxy, based on observed proxy compatibility errors.
@@ -34,16 +34,11 @@
3434
* </ul>
3535
* <p>Only an explicit proxy outdated error triggers fallback. Generic 400s do not.</p>
3636
*
37-
* <p>This class provides the following functionality:</p>
38-
* <ul>
39-
* <li>Tracks proxy errors and updates the state machine accordingly.</li>
40-
* <li>Performs periodic proxy checks to attempt recovery.</li>
41-
* <li>Provides the current spec version based on the state machine.</li>
42-
* <li>Indicates whether the SDK is in fallback or recovery mode.</li>
43-
* </ul>
4437
*/
4538
public class OutdatedSplitProxyHandler {
4639

40+
private static final String PREVIOUS_SPEC = "1.2";
41+
4742
private final String mLatestSpec;
4843
private final String mPreviousSpec;
4944
private final boolean mForBackgroundSync;
@@ -53,6 +48,10 @@ public class OutdatedSplitProxyHandler {
5348
private final GeneralInfoStorage mGeneralInfoStorage;
5449
private final AtomicReference<ProxyHandlingType> mCurrentProxyHandlingType = new AtomicReference<>(ProxyHandlingType.NONE);
5550

51+
OutdatedSplitProxyHandler(String flagSpec, boolean forBackgroundSync, GeneralInfoStorage generalInfoStorage, long proxyCheckIntervalMillis) {
52+
this(flagSpec, PREVIOUS_SPEC, forBackgroundSync, generalInfoStorage, proxyCheckIntervalMillis);
53+
}
54+
5655
/**
5756
* Constructs an OutdatedSplitProxyHandler instance with a custom proxy check interval.
5857
*

src/main/java/io/split/android/client/service/splits/SplitsSyncHelper.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ public SplitsSyncHelper(@NonNull HttpFetcher<TargetingRulesChange> splitFetcher,
113113
mRuleBasedSegmentStorage = checkNotNull(ruleBasedSegmentStorage);
114114
mTelemetryRuntimeProducer = checkNotNull(telemetryRuntimeProducer);
115115
mBackoffCounter = checkNotNull(backoffCounter);
116-
String mPreviousSpec = "1.2";
117-
mOutdatedSplitProxyHandler = new OutdatedSplitProxyHandler(flagsSpec, mPreviousSpec, forBackgroundSync, generalInfoStorage, proxyCheckIntervalMillis);
116+
mOutdatedSplitProxyHandler = new OutdatedSplitProxyHandler(flagsSpec, forBackgroundSync, generalInfoStorage, proxyCheckIntervalMillis);
118117
}
119118

120119
public SplitTaskExecutionInfo sync(SinceChangeNumbers till, int onDemandFetchBackoffMaxRetries) {

0 commit comments

Comments
 (0)