Skip to content

Commit 11077d8

Browse files
committed
fixing the comments.
1 parent 649a2ac commit 11077d8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/remote-config/src/client/realtime_handler.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ export class RealtimeHandler {
118118
const currentTime = Date.now();
119119
const backoffDurationInMillis = retryIntervalSeconds * 1000;
120120
const backoffEndTime = new Date(currentTime + backoffDurationInMillis);
121-
const numFailedStreams =
122-
(await this.storage.getRealtimeBackoffMetadata())?.numFailedStreams || 0;
121+
const numFailedStreams = 0;
123122
await this.storage.setRealtimeBackoffMetadata({
124123
backoffEndTimeMillis: backoffEndTime,
125124
numFailedStreams
@@ -159,7 +158,7 @@ export class RealtimeHandler {
159158
} catch (e) {
160159
// The network connection was lost, so cancel() failed.
161160
// This is expected in a disconnected state, so we can safely ignore the error.
162-
this.logger.debug('Failed to cancel the reader, connection is gone.');
161+
this.logger.debug('Failed to cancel the reader, connection was lost.');
163162
} finally {
164163
this.reader = undefined;
165164
}
@@ -550,7 +549,7 @@ export class RealtimeHandler {
550549
await this.handleNotifications(reader);
551550
} catch (e) {
552551
// If the real-time connection is at an unexpected lifecycle state when the app is
553-
// backgrounded, it's expected closing the connection and will throw an exception.
552+
// backgrounded, it's expected closing the connection will throw an exception.
554553
if (!this.isInBackground) {
555554
// Otherwise, the real-time server connection was closed due to a transient issue.
556555
this.logger.debug(
@@ -588,7 +587,6 @@ export class RealtimeHandler {
588587
let response: Response | undefined;
589588
let responseCode: number | undefined;
590589
try {
591-
//this has been called in the try cause it throws an error if the method does not get implemented
592590
response = await this.createRealtimeConnection();
593591
responseCode = response.status;
594592
if (response.ok && response.body) {

packages/remote-config/src/client/rest_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class RestClient implements RemoteConfigFetchClient {
8383
const url = `${urlBase}/v1/projects/${this.projectId}/namespaces/${this.namespace}:fetch?key=${this.apiKey}`;
8484

8585
const fetchType = request.fetchType || 'BASE';
86-
const fetchAttempt = request.fetchAttempt || 0;
86+
const fetchAttempt = request.fetchAttempt || 1;
8787

8888
const headers = {
8989
'Content-Type': 'application/json',

0 commit comments

Comments
 (0)