Skip to content
Merged
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
8 changes: 7 additions & 1 deletion lib/Redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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 452 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

Check warning on line 452 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
if (!reconnect) {
this.manuallyClosing = true;
}
Expand All @@ -457,7 +457,13 @@
clearTimeout(this.reconnectTimeout);
this.reconnectTimeout = null;
}
if (this.status === "wait") {
if (this.status === "reconnecting" && !reconnect) {
// The socket already closed and its "close" ran before the retry was
// scheduled, so nothing would ever emit "end": end it here.
this.manuallyClosing = false;
this.setStatus("end");
this.flushQueue(new Error(CONNECTION_CLOSED_ERROR_MSG));
} else if (this.status === "wait") {
eventHandler.closeHandler(this)();
} else {
this.connector.disconnect();
Expand All @@ -469,7 +475,7 @@
*
* @deprecated
*/
end() {

Check warning on line 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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 478 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

Check warning on line 478 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
this.disconnect();
}

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

Check warning on line 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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 491 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

Check warning on line 491 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
override?: Override
): Redis<ReplyMappingFromOptions<ReplyMapping, Override>> {
return new Redis({
Expand Down Expand Up @@ -531,7 +537,7 @@
* });
* ```
*/
monitor(callback?: Callback<Redis>): Promise<Redis> {

Check warning on line 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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 540 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

Check warning on line 540 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
const monitorInstance = this.duplicate({
monitor: true,
lazyConnect: false,
Expand Down Expand Up @@ -566,7 +572,7 @@
*
* @ignore
*/
sendCommand(command: Command, stream?: WriteableStream): unknown {

Check warning on line 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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 575 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

Check warning on line 575 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
command.setReplyContext(this.condition ?? this.options);

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

scanStream(options?: ScanStreamOptions) {

Check warning on line 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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 1233 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

Check warning on line 1233 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
return this.createScanStream("scan", { options });
}

scanBufferStream(options?: ScanStreamOptions) {

Check warning on line 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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 1237 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

Check warning on line 1237 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
return this.createScanStream("scanBuffer", { options });
}

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

Check warning on line 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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 1241 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

Check warning on line 1241 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
return this.createScanStream("sscan", { key, options });
}

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

Check warning on line 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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 1245 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

Check warning on line 1245 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
return this.createScanStream("sscanBuffer", { key, options });
}

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

Check warning on line 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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 1249 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

Check warning on line 1249 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
return this.createScanStream("hscan", { key, options });
}

Expand Down
22 changes: 21 additions & 1 deletion test/functional/disconnection.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import Redis from "../../lib/Redis";
import * as sinon from "sinon";
import { expect } from "chai";
import { expect, use } from "chai";
import MockServer from "../helpers/mock_server";

use(require("chai-as-promised"));

describe("disconnection", () => {
afterEach(() => {
sinon.restore();
Expand All @@ -26,6 +28,24 @@ describe("disconnection", () => {
});
});

["disconnect", "quit"].forEach((method) => {
it(`should end when ${method}() is called while reconnecting`, async () => {
const server = new MockServer(30001);
const redis = new Redis({ port: 30001, retryStrategy: () => 1000 });
await new Promise((resolve) => redis.once("ready", resolve));

server.disconnect();
await new Promise((resolve) => redis.once("reconnecting", resolve));
await redis[method]();
await new Promise((resolve) => setImmediate(resolve));

expect(redis.status).to.equal("end");
await expect(redis.get("foo")).to.be.rejectedWith(
"Connection is closed."
);
});
});

it("should clear all timers on server exits", (done) => {
const server = new MockServer(30000);

Expand Down
Loading