Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions lib/DataHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export interface Condition {
export type FlushQueueOptions = {
offlineQueue?: boolean;
commandQueue?: boolean;
// Commands stashed when a ready connection dropped. Only a flush the client
// cannot come back from settles them; a flush that is followed by another
// reconnect attempt leaves them for the ready handler to resend.
prevCommandQueue?: boolean;
};

export interface DataHandledable extends EventEmitter {
Expand Down
18 changes: 17 additions & 1 deletion lib/Redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
private connector: AbstractConnector;
private reconnectTimeout: ReturnType<typeof setTimeout> | null = null;
private offlineQueue: Deque;
private prevCommandQueue: Deque<CommandItem> | null = null;
private connectionEpoch = 0;
private retryAttempts = 0;
private manuallyClosing = false;
Expand Down Expand Up @@ -381,7 +382,7 @@
* and may lose some pending replies that haven't written to client.
* If you want to wait for the pending replies, use Redis#quit instead.
*/
disconnect(reconnect = false) {

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member disconnect should be declared before all private instance method definitions

Check warning on line 385 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member disconnect should be declared before all private instance method definitions
if (!reconnect) {
this.manuallyClosing = true;
}
Expand All @@ -401,7 +402,7 @@
*
* @deprecated
*/
end() {

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member end should be declared before all private instance method definitions

Check warning on line 405 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member end should be declared before all private instance method definitions
this.disconnect();
}

Expand All @@ -414,7 +415,7 @@
* var anotherRedis = redis.duplicate();
* ```
*/
duplicate<Override extends Partial<RedisOptions> | undefined = undefined>(

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member duplicate should be declared before all private instance method definitions

Check warning on line 418 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member duplicate should be declared before all private instance method definitions
override?: Override
): Redis<ReplyMappingFromOptions<ReplyMapping, Override>> {
return new Redis({
Expand Down Expand Up @@ -463,7 +464,7 @@
* });
* ```
*/
monitor(callback?: Callback<Redis>): Promise<Redis> {

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member monitor should be declared before all private instance method definitions

Check warning on line 467 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member monitor should be declared before all private instance method definitions
const monitorInstance = this.duplicate({
monitor: true,
lazyConnect: false,
Expand Down Expand Up @@ -498,7 +499,7 @@
*
* @ignore
*/
sendCommand(command: Command, stream?: WriteableStream): unknown {

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member sendCommand should be declared before all private instance method definitions

Check warning on line 502 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member sendCommand should be declared before all private instance method definitions
command.setReplyContext(this.condition ?? this.options);

if (this.status === "wait") {
Expand Down Expand Up @@ -741,23 +742,23 @@
});
}

scanStream(options?: ScanStreamOptions) {

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member scanStream should be declared before all private instance method definitions

Check warning on line 745 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member scanStream should be declared before all private instance method definitions
return this.createScanStream("scan", { options });
}

scanBufferStream(options?: ScanStreamOptions) {

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member scanBufferStream should be declared before all private instance method definitions

Check warning on line 749 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member scanBufferStream should be declared before all private instance method definitions
return this.createScanStream("scanBuffer", { options });
}

sscanStream(key: string, options?: ScanStreamOptions) {

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member sscanStream should be declared before all private instance method definitions

Check warning on line 753 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member sscanStream should be declared before all private instance method definitions
return this.createScanStream("sscan", { key, options });
}

sscanBufferStream(key: string, options?: ScanStreamOptions) {

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member sscanBufferStream should be declared before all private instance method definitions

Check warning on line 757 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member sscanBufferStream should be declared before all private instance method definitions
return this.createScanStream("sscanBuffer", { key, options });
}

hscanStream(key: string, options?: ScanStreamOptions) {

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.2)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, custom-30445126297-debian)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.4.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.8.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, rs-7.4.0-v1)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.8.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, rs-7.4.0-v1)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.2)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, 8.8.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.2)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.4.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, rs-7.4.0-v1)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, custom-30445126297-debian)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, custom-30445126297-debian)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (22.x, custom-30445126297-debian)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, 8.2)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.4.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (20.x, rs-7.4.0-v1)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (26.x, 8.4.0)

Member hscanStream should be declared before all private instance method definitions

Check warning on line 761 in lib/Redis.ts

View workflow job for this annotation

GitHub Actions / test / test (24.x, 8.8.0)

Member hscanStream should be declared before all private instance method definitions
return this.createScanStream("hscan", { key, options });
}

Expand Down Expand Up @@ -818,7 +819,10 @@
err: Error,
options: FlushQueueOptions
) {
this.flushQueue(err, options);
// `disconnect(true)` below keeps reconnecting, so a later attempt can still
// reach "ready" and resend the stashed commands. Rejecting them here would
// abandon them after a single failed attempt.
this.flushQueue(err, { ...options, prevCommandQueue: false });
this.silentEmit("error", err);
this.disconnect(true);
}
Expand Down Expand Up @@ -1015,6 +1019,7 @@
options = defaults({}, options, {
offlineQueue: true,
commandQueue: true,
prevCommandQueue: true,
});

let item;
Expand All @@ -1034,6 +1039,17 @@
item.command.reject(error);
}
}

// Commands that were in flight when a ready connection dropped are
// stashed in `prevCommandQueue`, and only the ready handler drains it.
// A reconnect replaces `commandQueue`, so a client that ends before
// becoming ready again has no other chance to settle them.
if (options.prevCommandQueue && this.prevCommandQueue) {
while ((item = this.prevCommandQueue.shift())) {
item.command.reject(error);
}
this.prevCommandQueue = null;
}
}
}

Expand Down
Loading
Loading