ioredis 5.3.0 → 5.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  A robust, performance-focused and full-featured [Redis](http://redis.io) client for [Node.js](https://nodejs.org).
10
10
 
11
- Supports Redis >= 2.6.12 and (Node.js >= 12.22.0). Completely compatible with Redis 7.x.
11
+ Supports Redis >= 2.6.12 and the latest version of [Dragonfly](https://dragonflydb.io/). Completely compatible with Redis 7.x.
12
12
 
13
13
  # Features
14
14
 
@@ -884,6 +884,15 @@ Alternatively, specify the connection through a [`rediss://` URL](https://www.ia
884
884
  const redis = new Redis("rediss://redis.my-service.com");
885
885
  ```
886
886
 
887
+ If you do not want to use a connection string, you can also specify an empty `tls: {}` object:
888
+
889
+ ```javascript
890
+ const redis = new Redis({
891
+ host: 'redis.my-service.com',
892
+ tls: {}
893
+ });
894
+ ```
895
+
887
896
  ### TLS Profiles
888
897
 
889
898
  > **Warning**
package/built/Redis.d.ts CHANGED
@@ -207,6 +207,20 @@ declare class Redis extends Commander implements DataHandledable {
207
207
  private _readyCheck;
208
208
  }
209
209
  interface Redis extends EventEmitter {
210
+ on(event: "message", cb: (channel: string, message: string) => void): this;
211
+ once(event: "message", cb: (channel: string, message: string) => void): this;
212
+ on(event: "messageBuffer", cb: (channel: Buffer, message: Buffer) => void): this;
213
+ once(event: "messageBuffer", cb: (channel: Buffer, message: Buffer) => void): this;
214
+ on(event: "pmessage", cb: (pattern: string, channel: string, message: string) => void): this;
215
+ once(event: "pmessage", cb: (pattern: string, channel: string, message: string) => void): this;
216
+ on(event: "pmessageBuffer", cb: (pattern: string, channel: Buffer, message: Buffer) => void): this;
217
+ once(event: "pmessageBuffer", cb: (pattern: string, channel: Buffer, message: Buffer) => void): this;
218
+ on(event: "error", cb: (error: Error) => void): this;
219
+ once(event: "error", cb: (error: Error) => void): this;
220
+ on(event: RedisStatus, cb: () => void): this;
221
+ once(event: RedisStatus, cb: () => void): this;
222
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
223
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
210
224
  }
211
225
  interface Redis extends Transaction {
212
226
  }
@@ -18,6 +18,7 @@ exports.notAllowedAutoPipelineCommands = [
18
18
  "psubscribe",
19
19
  "unsubscribe",
20
20
  "unpsubscribe",
21
+ "select",
21
22
  ];
22
23
  function executeAutoPipeline(client, slotKey) {
23
24
  /*
@@ -134,17 +134,22 @@ function abortTransactionFragments(commandQueue) {
134
134
  }
135
135
  function closeHandler(self) {
136
136
  return function () {
137
+ const prevStatus = self.status;
137
138
  self.setStatus("close");
138
- if (!self.prevCondition) {
139
- self.prevCondition = self.condition;
140
- }
141
139
  if (self.commandQueue.length) {
142
140
  abortIncompletePipelines(self.commandQueue);
143
- self.prevCommandQueue = self.commandQueue;
144
141
  }
145
142
  if (self.offlineQueue.length) {
146
143
  abortTransactionFragments(self.offlineQueue);
147
144
  }
145
+ if (prevStatus === "ready") {
146
+ if (!self.prevCondition) {
147
+ self.prevCondition = self.condition;
148
+ }
149
+ if (self.commandQueue.length) {
150
+ self.prevCommandQueue = self.commandQueue;
151
+ }
152
+ }
148
153
  if (self.manuallyClosing) {
149
154
  self.manuallyClosing = false;
150
155
  debug("skip reconnecting since the connection is manually closed.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ioredis",
3
- "version": "5.3.0",
3
+ "version": "5.3.2",
4
4
  "description": "A robust, performance-focused and full-featured Redis client for Node.js.",
5
5
  "main": "./built/index.js",
6
6
  "types": "./built/index.d.ts",