@firebase/remote-config 0.9.2 → 0.9.3-20260929163754
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.esm.js +37 -18
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/test/setup.d.ts +0 -1
- package/dist/index.cjs.js +37 -18
- package/dist/index.cjs.js.map +1 -1
- package/dist/test/setup.d.ts +0 -1
- package/dist/{src/tsdoc-metadata.json → tsdoc-metadata.json} +1 -1
- package/package.json +9 -14
package/dist/esm/test/setup.d.ts
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -9,7 +9,7 @@ var logger = require('@firebase/logger');
|
|
|
9
9
|
require('@firebase/installations');
|
|
10
10
|
|
|
11
11
|
const name = "@firebase/remote-config";
|
|
12
|
-
const version = "0.9.
|
|
12
|
+
const version = "0.9.3-20260929163754";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @license
|
|
@@ -2067,26 +2067,45 @@ class RealtimeHandler {
|
|
|
2067
2067
|
}
|
|
2068
2068
|
}
|
|
2069
2069
|
finally {
|
|
2070
|
+
// Capture the visibility state before closing the connection. Closing is
|
|
2071
|
+
// asynchronous, so the app may return to the foreground before it completes,
|
|
2072
|
+
// and an expected background close would then be misread as a failure.
|
|
2073
|
+
const wasInBackground = this.isInBackground;
|
|
2070
2074
|
// Close HTTP connection and associated streams.
|
|
2071
2075
|
await this.closeRealtimeHttpConnection();
|
|
2072
2076
|
this.setIsHttpConnectionRunning(false);
|
|
2073
|
-
//
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2077
|
+
// Nothing to do while the app is hidden. A retry cannot run, and recording a
|
|
2078
|
+
// backoff penalty would persist a failure that never happened.
|
|
2079
|
+
if (!this.isInBackground) {
|
|
2080
|
+
if (wasInBackground) {
|
|
2081
|
+
// The connection was closed because the app moved to the background, and
|
|
2082
|
+
// the app returned to the foreground before the teardown finished. The
|
|
2083
|
+
// reconnect attempted at that point was skipped because this connection
|
|
2084
|
+
// was still active, so it has to be made here. Backgrounding is not a
|
|
2085
|
+
// failure, so restore the retry budget rather than spending it, which
|
|
2086
|
+
// also keeps an exhausted budget from surfacing a stream error.
|
|
2087
|
+
this.resetRetryCount();
|
|
2088
|
+
await this.retryHttpConnectionWhenBackoffEnds();
|
|
2089
|
+
}
|
|
2090
|
+
else {
|
|
2091
|
+
// Update backoff metadata if the connection failed in the foreground.
|
|
2092
|
+
const connectionFailed = responseCode === undefined ||
|
|
2093
|
+
this.isStatusCodeRetryable(responseCode);
|
|
2094
|
+
if (connectionFailed) {
|
|
2095
|
+
await this.updateBackoffMetadataWithLastFailedStreamConnectionTime(new Date());
|
|
2096
|
+
}
|
|
2097
|
+
// If responseCode is null then no connection was made to server and the SDK should still retry.
|
|
2098
|
+
if (connectionFailed || response?.ok) {
|
|
2099
|
+
await this.retryHttpConnectionWhenBackoffEnds();
|
|
2100
|
+
}
|
|
2101
|
+
else {
|
|
2102
|
+
const errorMessage = `Unable to connect to the server. HTTP status code: ${responseCode}`;
|
|
2103
|
+
const firebaseError = ERROR_FACTORY.create("stream-error" /* ErrorCode.CONFIG_UPDATE_STREAM_ERROR */, {
|
|
2104
|
+
originalErrorMessage: errorMessage
|
|
2105
|
+
});
|
|
2106
|
+
this.propagateError(firebaseError);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2090
2109
|
}
|
|
2091
2110
|
}
|
|
2092
2111
|
}
|