Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions packages/client/src/sync/fetcher/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@
protected destroyWhenDone: boolean // Destroy the fetcher once we are finished processing each task.
syncErrored?: Error

private _readableState?: {
// This property is inherited from Readable. We only need `length`.
length: number
}

private writer: Writable | null = null

/**
Expand Down Expand Up @@ -352,10 +347,13 @@
return false
}
const jobStr = this.jobStr(job)
if (this._readableState === undefined || this._readableState!.length > this.maxQueue) {
if (
(<any>this)._readableState === undefined ||
(<any>this)._readableState!.length > this.maxQueue
) {
this.DEBUG &&
this.debug(
`Readable state length=${this._readableState!.length} exceeds max queue size=${
`Readable state length=${(<any>this)._readableState!.length} exceeds max queue size=${

Check warning on line 356 in packages/client/src/sync/fetcher/fetcher.ts

View check run for this annotation

Codecov / codecov/patch

packages/client/src/sync/fetcher/fetcher.ts#L356

Added line #L356 was not covered by tests
Copy link
Member Author

@jochem-brouwer jochem-brouwer Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work if _readableState is undefined, and if we cast as ! it will definitely error if it is undefined 🤔

(did not change this logic, just entered an any here)

this.maxQueue
}, skip job ${jobStr} execution.`,
)
Expand Down
Loading