Skip to content

Commit b744b9d

Browse files
Comment fixes
1 parent 8ad4df2 commit b744b9d

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

packages/firestore/src/remote/persistent_stream.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export abstract class PersistentStream<
256256
// We ignore Promise rejections for cancelled idle checks.
257257
assert(
258258
err.code === Code.CANCELLED,
259-
'Received unexpected error in idle timeout closure.'
259+
`Received unexpected error in idle timeout closure. Expected CANCELLED, but was: ${err}`
260260
);
261261
});
262262
}
@@ -293,7 +293,7 @@ export abstract class PersistentStream<
293293
* </ul>
294294
*
295295
* A new stream can be opened by calling `start` unless `finalState` is set to
296-
* `PersistentStreamState.Stoppen`.
296+
* `PersistentStreamState.Stopped`.
297297
*
298298
* @param finalState the intended state of the stream after closing.
299299
* @param error the error the connection was closed with.
@@ -324,17 +324,15 @@ export abstract class PersistentStream<
324324
// inhibit backoff or otherwise manipulate the state in its non-started state.
325325
this.state = finalState;
326326

327-
// Clean up the underlying stream because we are no longer interested in
328-
// events
327+
// Clean up the underlying stream because we are no longer interested in events.
329328
if (this.stream !== null) {
330329
this.stream.close();
331330
this.stream = null;
332331
}
333332

334333
const listener = this.listener!;
335334

336-
// Clear the listener to avoid bleeding of events from the underlying
337-
// streams
335+
// Clear the listener to avoid bleeding of events from the underlying streams.
338336
this.listener = null;
339337

340338
// If the caller explicitly requested a stream stop, don't notify them of a closing stream (it

packages/firestore/src/util/async_queue.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export class AsyncQueue {
2424
// The last promise in the queue.
2525
private tail: Promise<AnyJs | void> = Promise.resolve();
2626

27-
// A map of timeout handles to the respective deferred promises. Contains an
28-
// entry for each operation that is still queued to be run in the future
29-
// (i.e. it has a delay that has not yet elapsed).
27+
// A map of timeout handles to their respective deferred promises. Contains an
28+
// entry for each operation that is still queued to run in the future (i.e. it
29+
// has a delay that has not yet elapsed).
3030
private delayedOperations: Map<number, Deferred<any>> = new Map();
3131

3232
// visible for testing

packages/firestore/test/integration/util/test_queue.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ const IDLE_DISPATCH_DELAY_MS = 60.0 * 1000;
2222
/** The maximum delay we use in a test run. */
2323
const TEST_DISPATCH_DELAY_MS = 1.0 * 1000;
2424

25+
/**
26+
* Dispatch queue used in the integration tests that caps delayed executions at
27+
* 1.0 seconds.
28+
*/
2529
export class TestQueue extends AsyncQueue {
2630
idleTimeoutDeferred: Deferred<void> | null = null;
2731

0 commit comments

Comments
 (0)