Skip to content

Commit 6786e12

Browse files
committed
chore: addressing cursor review
1 parent 9a9e637 commit 6786e12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/sdk/browser/src/BrowserDataManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ export default class BrowserDataManager extends BaseDataManager {
136136
let lastError: any;
137137
let validMaxRetries = maxRetries ?? 3;
138138

139-
if (validMaxRetries < 0) {
139+
if (Number.isNaN(validMaxRetries) || validMaxRetries < 0) {
140140
this.logger.warn(
141-
`initialPollingRetries is set to ${maxRetries}, which is less than 0. This is not supported and will be ignored. Defaulting to 3 retries.`,
141+
`initialPollingRetries is set to an invalid value: ${maxRetries}. Defaulting to 3 retries.`,
142142
);
143143
validMaxRetries = 3;
144144
}
@@ -152,12 +152,12 @@ export default class BrowserDataManager extends BaseDataManager {
152152
throw e;
153153
}
154154
lastError = e;
155-
this._debugLog(httpErrorMessage(e, 'initial poll request', 'will retry'));
156155
// NOTE: current we are hardcoding the retry interval to 1 second.
157156
// We can make this configurable in the future.
158157
// TODO: Reviewer any thoughts on this? Probably the easiest thing is to make this configurable
159158
// however, we can also look into using the backoff logic to calculate the delay?
160159
if (attempt < validMaxRetries) {
160+
this._debugLog(httpErrorMessage(e, 'initial poll request', 'will retry'));
161161
// eslint-disable-next-line no-await-in-loop
162162
await sleep(1000);
163163
}

0 commit comments

Comments
 (0)