Skip to content

Commit 20108ce

Browse files
committed
AI feedback
1 parent 2b132ef commit 20108ce

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/common/src/client/sync/stream/AbstractRemote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,13 +523,13 @@ export abstract class AbstractRemote {
523523
* Aborting the active fetch request while it is being consumed seems to throw
524524
* an unhandled exception on the window level.
525525
*/
526-
if (abortSignal?.aborted) {
526+
if (abortSignal.aborted) {
527527
throw new AbortOperation('Abort request received before making fetchStreamRaw request');
528528
}
529529

530530
const controller = new AbortController();
531531
let reader: ReadableStreamDefaultReader<Uint8Array> | null = null;
532-
abortSignal?.addEventListener('abort', () => {
532+
abortSignal.addEventListener('abort', () => {
533533
const reason =
534534
abortSignal.reason ??
535535
new AbortOperation('Cancelling network request before it resolves. Abort signal has been received.');

packages/common/src/client/sync/stream/AbstractStreamingSyncImplementation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ The next upload iteration will be delayed.`);
689689
});
690690
}
691691

692-
async receiveSyncLines(data: {
692+
private async receiveSyncLines(data: {
693693
options: SyncStreamOptions;
694694
connection: RequiredPowerSyncConnectionOptions;
695695
bson?: typeof BSON;

packages/common/src/utils/stream_transform.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function map<T1, T2>(source: SimpleAsyncIterator<T1>, map: (source: T1) =
3131
}
3232

3333
export interface InjectableIterator<T> extends SimpleAsyncIterator<T> {
34-
inject(event: T);
34+
inject(event: T): void;
3535
}
3636

3737
/**
@@ -84,7 +84,7 @@ export function injectable<T>(source: SimpleAsyncIterator<T>): InjectableIterato
8484
return {
8585
next: () => {
8686
return new Promise((resolve, reject) => {
87-
// First priority: Dispatch from upstream
87+
// First priority: Dispatch ready upstream events.
8888
if (sourceIsDone) {
8989
return resolve(doneResult);
9090
}
@@ -155,8 +155,8 @@ export function extractJsonLines(
155155
buffer += data;
156156

157157
const lines = buffer.split('\n');
158-
for (var i = 0; i < lines.length - 1; i++) {
159-
var l = lines[i].trim();
158+
for (let i = 0; i < lines.length - 1; i++) {
159+
const l = lines[i].trim();
160160
if (l.length > 0) {
161161
pendingLines.push(l);
162162
}

packages/common/tests/utils/stream_transform.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('extractJsonLines', () => {
4040
});
4141
});
4242

43-
describe('injectible', () => {
43+
describe('injectable', () => {
4444
test('forwards upstream events', async () => {
4545
async function* source() {
4646
yield 1;

0 commit comments

Comments
 (0)