Skip to content

Commit 556e230

Browse files
Enhance proxy fallback handling
1 parent a3f6481 commit 556e230

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.4.1 (June 3, 2025)
2+
- Bugfix - Enhanced the Proxy fallback to flag spec version 1.2 to support some Fetch API implementations that might fail to handle Proxy 400 responses.
3+
14
2.4.0 (May 27, 2025)
25
- Added support for rule-based segments. These segments determine membership at runtime by evaluating their configured rules against the user attributes provided to the SDK.
36
- Added support for feature flag prerequisites. This allows customers to define dependency conditions between flags, which are evaluated before any allowlists or targeting rules.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-commons",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Split JavaScript SDK common components",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/sync/polling/fetchers/splitChangesFetcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ export function splitChangesFetcherFactory(fetchSplitChanges: IFetchSplitChanges
4040
}
4141

4242
let splitsPromise = fetchSplitChanges(since, noCache, till, settings.sync.flagSpecVersion === FLAG_SPEC_VERSION ? rbSince : undefined)
43-
// Handle proxy error with spec 1.3
4443
.catch((err) => {
45-
if (err.statusCode === 400 && sdkEndpointOverridden(settings) && settings.sync.flagSpecVersion === FLAG_SPEC_VERSION) {
44+
// Handle proxy error with spec 1.3
45+
if ((!err.statusCode || err.statusCode === 400) && sdkEndpointOverridden(settings) && settings.sync.flagSpecVersion === FLAG_SPEC_VERSION) {
4646
log.error(LOG_PREFIX_SYNC_SPLITS + 'Proxy error detected. Retrying with spec 1.2. If you are using Split Proxy, please upgrade to latest version');
4747
lastProxyCheckTimestamp = Date.now();
4848
settings.sync.flagSpecVersion = '1.2'; // fallback to 1.2 spec

0 commit comments

Comments
 (0)