redis 2.7.0 → 3.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,880 @@
1
+ # Changelog
2
+
3
+ ## v3.0.0 - 09 Feb, 2020
4
+
5
+ This version is mainly a release to distribute all the unreleased changes on master since 2017 and additionally removes
6
+ a lot of old deprecated features and old internals in preparation for an upcoming modernization refactor (v4).
7
+
8
+ ### Breaking Changes
9
+
10
+ - Dropped support for Node.js < 6
11
+ - Dropped support for `hiredis` (no longer required)
12
+ - Removed previously deprecated `drain` event
13
+ - Removed previously deprecated `idle` event
14
+ - Removed previously deprecated `parser` option
15
+ - Removed previously deprecated `max_delay` option
16
+ - Removed previously deprecated `max_attempts` option
17
+ - Removed previously deprecated `socket_no_delay` option
18
+
19
+ ### Bug Fixes
20
+
21
+ - Removed development files from published package (#1370)
22
+ - Duplicate function now allows db param to be passed (#1311)
23
+
24
+ ### Features
25
+
26
+ - Upgraded to latest `redis-commands` package
27
+ - Upgraded to latest `redis-parser` package, v3.0.0, which brings performance improvements
28
+ - Replaced `double-ended-queue` with `denque`, which brings performance improvements
29
+ - Add timestamps to debug traces
30
+ - Add `socket_initial_delay` option for `socket.setKeepAlive` (#1396)
31
+ - Add support for `rediss` protocol in url (#1282)
32
+
33
+ ## v2.8.0 - 31 Jul, 2017
34
+
35
+ Features
36
+
37
+ - Accept UPPER_CASE commands in send_command
38
+ - Add arbitrary commands to the prototype by using `Redis.addCommand(name)`
39
+
40
+ Bugfixes
41
+
42
+ - Fixed not always copying subscribe unsubscribe arguments
43
+ - Fixed emitting internal errors while reconnecting with auth
44
+ - Fixed crashing with invalid url option
45
+
46
+ ## v2.7.1 - 14 Mar, 2017
47
+
48
+ Bugfixes
49
+
50
+ - Fixed monitor mode not working in combination with IPv6 (2.6.0 regression)
51
+
52
+ ## v2.7.0 - 11 Mar, 2017
53
+
54
+ Features
55
+
56
+ - All returned errors are from now a subclass of `RedisError`.
57
+
58
+ Bugfixes
59
+
60
+ - Fixed rename_commands not accepting `null` as value
61
+ - Fixed `AbortError`s and `AggregateError`s not showing the error message in the stack trace
62
+
63
+ ## v2.6.5 - 15 Jan, 2017
64
+
65
+ Bugfixes
66
+
67
+ - Fixed parser not being reset in case the redis connection closed ASAP for overcoming of output buffer limits
68
+ - Fixed parser reset if (p)message_buffer listener is attached
69
+
70
+ ## v2.6.4 - 12 Jan, 2017
71
+
72
+ Bugfixes
73
+
74
+ - Fixed monitor mode not working in combination with IPv6, sockets or lua scripts (2.6.0 regression)
75
+
76
+ ## v2.6.3 - 31 Oct, 2016
77
+
78
+ Bugfixes
79
+
80
+ - Do not change the tls setting to camel_case
81
+ - Fix domain handling in combination with the offline queue (2.5.3 regression)
82
+
83
+ ## v2.6.2 - 16 Jun, 2016
84
+
85
+ Bugfixes
86
+
87
+ - Fixed individual callbacks of a transaction not being called (2.6.0 regression)
88
+
89
+ ## v2.6.1 - 02 Jun, 2016
90
+
91
+ Bugfixes
92
+
93
+ - Fixed invalid function name being exported
94
+
95
+ ## v2.6.0 - 01 Jun, 2016
96
+
97
+ In addition to the pre-releases the following changes exist in v.2.6.0:
98
+
99
+ Features
100
+
101
+ - Updated [redis-parser](https://github.com/NodeRedis/node-redis-parser) dependency ([changelog](https://github.com/NodeRedis/node-redis-parser/releases/tag/v.2.0.0))
102
+ - The JS parser is from now on the new default as it is a lot faster than the hiredis parser
103
+ - This is no BC as there is no changed behavior for the user at all but just a performance improvement. Explicitly requireing the Hiredis parser is still possible.
104
+ - Added name property to all Redis functions (Node.js >= 4.0)
105
+ - Improved stack traces in development and debug mode
106
+
107
+ Bugfixes
108
+
109
+ - Reverted support for `__proto__` (v.2.6.0-2) to prevent and breaking change
110
+
111
+ Deprecations
112
+
113
+ - The `parser` option is deprecated and should be removed. The built-in Javascript parser is a lot faster than the hiredis parser and has more features
114
+
115
+ ## v2.6.0-2 - 29 Apr, 2016
116
+
117
+ Features
118
+
119
+ - Added support for the new [CLIENT REPLY ON|OFF|SKIP](http://redis.io/commands/client-reply) command (Redis v.3.2)
120
+ - Added support for camelCase
121
+ - The Node.js landscape default is to use camelCase. node_redis is a bit out of the box here
122
+ but from now on it is possible to use both, just as you prefer!
123
+ - If there's any documented variable missing as camelCased, please open a issue for it
124
+ - Improve error handling significantly
125
+ - Only emit an error if the error has not already been handled in a callback
126
+ - Improved unspecific error messages e.g. "Connection gone from end / close event"
127
+ - Added `args` to command errors to improve identification of the error
128
+ - Added origin to errors if there's e.g. a connection error
129
+ - Added ReplyError class. All Redis errors are from now on going to be of that class
130
+ - Added AbortError class. A subclass of AbortError. All unresolved and by node_redis rejected commands are from now on of that class
131
+ - Added AggregateError class. If a unresolved and by node_redis rejected command has no callback and
132
+ this applies to more than a single command, the errors for the commands without callback are aggregated
133
+ to a single error that is emitted in debug_mode in that case.
134
+ - Added `message_buffer` / `pmessage_buffer` events. That event is always going to emit a buffer
135
+ - Listening to the `message` event at the same time is always going to return the same message as string
136
+ - Added callback option to the duplicate function
137
+ - Added support for `__proto__` and other reserved keywords as hgetall field
138
+ - Updated [redis-commands](https://github.com/NodeRedis/redis-commands) dependency ([changelog](https://github.com/NodeRedis/redis-commands/releases/tag/v.1.2.0))
139
+
140
+ Bugfixes
141
+
142
+ - Fixed v.2.5.0 auth command regression (under special circumstances a reconnect would not authenticate properly)
143
+ - Fixed v.2.6.0-0 pub sub mode and quit command regressions:
144
+ - Entering pub sub mode not working if a earlier called and still running command returned an error
145
+ - Unsubscribe callback not called if unsubscribing from all channels and resubscribing right away
146
+ - Quit command resulting in an error in some cases
147
+ - Fixed special handled functions in batch and multi context not working the same as without (e.g. select and info)
148
+ - Be aware that not all commands work in combination with transactions but they all work with batch
149
+ - Fixed address always set to 127.0.0.1:6379 in case host / port is set in the `tls` options instead of the general options
150
+
151
+ ## v2.6.0-1 - 01 Apr, 2016
152
+
153
+ A second pre-release with further fixes. This is likely going to be released as 2.6.0 stable without further changes.
154
+
155
+ Features
156
+
157
+ - Added type validations for client.send_command arguments
158
+
159
+ Bugfixes
160
+
161
+ - Fixed client.send_command not working properly with every command and every option
162
+ - Fixed pub sub mode unsubscribing from all channels in combination with the new `string_numbers` option crashing
163
+ - Fixed pub sub mode unsubscribing from all channels not respected while reconnecting
164
+ - Fixed pub sub mode events in combination with the `string_numbers` option emitting the number of channels not as number
165
+
166
+ ## v2.6.0-0 - 27 Mar, 2016
167
+
168
+ This is mainly a very important bug fix release with some smaller features.
169
+
170
+ Features
171
+
172
+ - Monitor and pub sub mode now work together with the offline queue
173
+ - All commands that were send after a connection loss are now going to be send after reconnecting
174
+ - Activating monitor mode does now work together with arbitrary commands including pub sub mode
175
+ - Pub sub mode is completely rewritten and all known issues fixed
176
+ - Added `string_numbers` option to get back strings instead of numbers
177
+ - Quit command is from now on always going to end the connection properly
178
+
179
+ Bugfixes
180
+
181
+ - Fixed calling monitor command while other commands are still running
182
+ - Fixed monitor and pub sub mode not working together
183
+ - Fixed monitor mode not working in combination with the offline queue
184
+ - Fixed pub sub mode not working in combination with the offline queue
185
+ - Fixed pub sub mode resubscribing not working with non utf8 buffer channels
186
+ - Fixed pub sub mode crashing if calling unsubscribe / subscribe in various combinations
187
+ - Fixed pub sub mode emitting unsubscribe even if no channels were unsubscribed
188
+ - Fixed pub sub mode emitting a message without a message published
189
+ - Fixed quit command not ending the connection and resulting in further reconnection if called while reconnecting
190
+
191
+ The quit command did not end connections earlier if the connection was down at that time and this could have
192
+ lead to strange situations, therefor this was fixed to end the connection right away in those cases.
193
+
194
+ ## v2.5.3 - 21 Mar, 2016
195
+
196
+ Bugfixes
197
+
198
+ - Revert throwing on invalid data types and print a warning instead
199
+
200
+ ## v2.5.2 - 16 Mar, 2016
201
+
202
+ Bugfixes
203
+
204
+ - Fixed breaking changes against Redis 2.4 introduced in 2.5.0 / 2.5.1
205
+
206
+ ## v2.5.1 - 15 Mar, 2016
207
+
208
+ Bugfixes
209
+
210
+ - Fixed info command not working anymore with optional section argument
211
+
212
+ ## v2.5.0 - 15 Mar, 2016
213
+
214
+ Same changelog as the pre-release
215
+
216
+ ## v2.5.0-1 - 07 Mar, 2016
217
+
218
+ This is a big release with some substantial underlining changes. Therefor this is released as a pre-release and I encourage anyone who's able to, to test this out.
219
+
220
+ It took way to long to release this one and the next release cycles will be shorter again.
221
+
222
+ This release is also going to deprecate a couple things to prepare for a future v.3 (it'll still take a while to v.3).
223
+
224
+ Features
225
+
226
+ - The parsers moved into the [redis-parser](https://github.com/NodeRedis/node-redis-parser) module and will be maintained in there from now on
227
+ - Improve js parser speed significantly for big SUNION/SINTER/LRANGE/ZRANGE
228
+ - Improve redis-url parsing to also accept the database-number and options as query parameters as suggested in [IANA](http://www.iana.org/assignments/uri-schemes/prov/redis)
229
+ - Added a `retry_unfulfilled_commands` option
230
+ - Setting this to 'true' results in retrying all commands that were not fulfilled on a connection loss after the reconnect. Use with caution
231
+ - Added a `db` option to select the database while connecting (this is [not recommended](https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg))
232
+ - Added a `password` option as alias for auth_pass
233
+ - The client.server_info is from now on updated while using the info command
234
+ - Gracefuly handle redis protocol errors from now on
235
+ - Added a `warning` emitter that receives node_redis warnings like auth not required and deprecation messages
236
+ - Added a `retry_strategy` option that replaces all reconnect options
237
+ - The reconnecting event from now on also receives:
238
+ - The error message why the reconnect happened (params.error)
239
+ - The amount of times the client was connected (params.times_connected)
240
+ - The total reconnecting time since the last time connected (params.total_retry_time)
241
+ - Always respect the command execution order no matter if the reply could be returned sync or not (former exceptions: [#937](https://github.com/NodeRedis/node_redis/issues/937#issuecomment-167525939))
242
+ - redis.createClient is now checking input values stricter and detects more faulty input
243
+ - Started refactoring internals into individual modules
244
+ - Pipelining speed improvements
245
+
246
+ Bugfixes
247
+
248
+ - Fixed explicit undefined as a command callback in a multi context
249
+ - Fixed hmset failing to detect the first key as buffer or date if the key is of that type
250
+ - Fixed do not run toString on an array argument and throw a "invalid data" error instead
251
+ - This is not considered as breaking change, as this is likely a error in your code and if you want to have such a behavior you should handle this beforehand
252
+ - The same applies to Map / Set and individual Object types
253
+ - Fixed redis url not accepting the protocol being omitted or protocols other than the redis protocol for convenience
254
+ - Fixed parsing the db keyspace even if the first database does not begin with a zero
255
+ - Fixed handling of errors occurring while receiving pub sub messages
256
+ - Fixed huge string pipelines crashing NodeJS (Pipeline size above 256mb)
257
+ - Fixed rename_commands and prefix option not working together
258
+ - Fixed ready being emitted to early in case a slave is still syncing / master down
259
+
260
+ Deprecations
261
+
262
+ - Using any command with a argument being set to null or undefined is deprecated
263
+ - From v.3.0.0 on using a command with such an argument will return an error instead
264
+ - If you want to keep the old behavior please use a precheck in your code that converts the arguments to a string.
265
+ - Using SET or SETEX with a undefined or null value will from now on also result in converting the value to "null" / "undefined" to have a consistent behavior. This is not considered as breaking change, as it returned an error earlier.
266
+ - Using .end(flush) without the flush parameter is deprecated and the flush parameter should explicitly be used
267
+ - From v.3.0.0 on using .end without flush will result in an error
268
+ - Using .end without flush means that any command that did not yet return is going to silently fail. Therefor this is considered harmful and you should explicitly silence such errors if you are sure you want this
269
+ - Depending on the return value of a command to detect the backpressure is deprecated
270
+ - From version 3.0.0 on node_redis might not return true / false as a return value anymore. Please rely on client.should_buffer instead
271
+ - The `socket_nodelay` option is deprecated and will be removed in v.3.0.0
272
+ - If you want to buffer commands you should use [.batch or .multi](./README.md) instead. This is necessary to reduce the amount of different options and this is very likely reducing your throughput if set to false.
273
+ - If you are sure you want to activate the NAGLE algorithm you can still activate it by using client.stream.setNoDelay(false)
274
+ - The `max_attempts` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead
275
+ - The `retry_max_delay` option is deprecated and will be removed in v.3.0.0. Please use the `retry_strategy` instead
276
+ - The drain event is deprecated and will be removed in v.3.0.0. Please listen to the stream drain event instead
277
+ - The idle event is deprecated and will likely be removed in v.3.0.0. If you rely on this feature please open a new ticket in node_redis with your use case
278
+ - Redis < v. 2.6 is not officially supported anymore and might not work in all cases. Please update to a newer redis version as it is not possible to test for these old versions
279
+ - Removed non documented command syntax (adding the callback to an arguments array instead of passing it as individual argument)
280
+
281
+ ## v2.4.2 - 27 Nov, 2015
282
+
283
+ Bugfixes
284
+
285
+ - Fixed not emitting ready after reconnect with disable_resubscribing ([@maxgalbu](https://github.com/maxgalbu))
286
+
287
+ ## v2.4.1 - 25 Nov, 2015
288
+
289
+ Bugfixes
290
+
291
+ - Fixed a js parser regression introduced in 2.4.0 ([@BridgeAR](https://github.com/BridgeAR))
292
+
293
+ ## v2.4.0 - 25 Nov, 2015
294
+
295
+ Features
296
+
297
+ - Added `tls` option to initiate a connection to a redis server behind a TLS proxy. Thanks ([@paddybyers](https://github.com/paddybyers))
298
+ - Added `prefix` option to auto key prefix any command with the provided prefix ([@luin](https://github.com/luin) & [@BridgeAR](https://github.com/BridgeAR))
299
+ - Added `url` option to pass the connection url with the options object ([@BridgeAR](https://github.com/BridgeAR))
300
+ - Added `client.duplicate([options])` to duplicate the current client and return a new one with the same options ([@BridgeAR](https://github.com/BridgeAR))
301
+ - Improve performance by up to 20% on almost all use cases ([@BridgeAR](https://github.com/BridgeAR))
302
+
303
+ Bugfixes
304
+
305
+ - Fixed js parser handling big values slow ([@BridgeAR](https://github.com/BridgeAR))
306
+ - The speed is now on par with the hiredis parser.
307
+
308
+ ## v2.3.1 - 18 Nov, 2015
309
+
310
+ Bugfixes
311
+
312
+ - Fixed saving buffers with charsets other than utf-8 while using multi ([@BridgeAR](https://github.com/BridgeAR))
313
+ - Fixed js parser handling big values very slow ([@BridgeAR](https://github.com/BridgeAR))
314
+ - The speed is up to ~500% faster than before but still up to ~50% slower than the hiredis parser.
315
+
316
+ ## v2.3.0 - 30 Oct, 2015
317
+
318
+ Features
319
+
320
+ - Improve speed further for: ([@BridgeAR](https://github.com/BridgeAR))
321
+ - saving big strings (up to +300%)
322
+ - using .multi / .batch (up to +50% / on Node.js 0.10.x +300%)
323
+ - saving small buffers
324
+ - Increased coverage to 99% ([@BridgeAR](https://github.com/BridgeAR))
325
+ - Refactored manual backpressure control ([@BridgeAR](https://github.com/BridgeAR))
326
+ - Removed the high water mark and low water mark. Such a mechanism should be implemented by a user instead
327
+ - The `drain` event is from now on only emitted if the stream really had to buffer
328
+ - Reduced the default connect_timeout to be one hour instead of 24h ([@BridgeAR](https://github.com/BridgeAR))
329
+ - Added .path to redis.createClient(options); ([@BridgeAR](https://github.com/BridgeAR))
330
+ - Ignore info command, if not available on server ([@ivanB1975](https://github.com/ivanB1975))
331
+
332
+ Bugfixes
333
+
334
+ - Fixed a js parser error that could result in a timeout ([@BridgeAR](https://github.com/BridgeAR))
335
+ - Fixed .multi / .batch used with Node.js 0.10.x not working properly after a reconnect ([@BridgeAR](https://github.com/BridgeAR))
336
+ - Fixed fired but not yet returned commands not being rejected after a connection loss ([@BridgeAR](https://github.com/BridgeAR))
337
+ - Fixed connect_timeout not respected if no connection has ever been established ([@gagle](https://github.com/gagle) & [@benjie](https://github.com/benjie))
338
+ - Fixed return_buffers in pub sub mode ([@komachi](https://github.com/komachi))
339
+
340
+ ## v2.2.5 - 18 Oct, 2015
341
+
342
+ Bugfixes
343
+
344
+ - Fixed undefined options passed to a new instance not accepted (possible with individual .createClient functions) ([@BridgeAR](https://github.com/BridgeAR))
345
+
346
+ ## v2.2.4 - 17 Oct, 2015
347
+
348
+ Bugfixes
349
+
350
+ - Fixed unspecific error message for unresolvable commands ([@BridgeAR](https://github.com/BridgeAR))
351
+ - Fixed not allowed command error in pubsub mode not being returned in a provided callback ([@BridgeAR](https://github.com/BridgeAR))
352
+ - Fixed to many commands forbidden in pub sub mode ([@BridgeAR](https://github.com/BridgeAR))
353
+ - Fixed mutation of the arguments array passed to .multi / .batch constructor ([@BridgeAR](https://github.com/BridgeAR))
354
+ - Fixed mutation of the options object passed to createClient ([@BridgeAR](https://github.com/BridgeAR))
355
+ - Fixed error callback in .multi not called if connection in broken mode ([@BridgeAR](https://github.com/BridgeAR))
356
+
357
+ ## v2.2.3 - 14 Oct, 2015
358
+
359
+ Bugfixes
360
+
361
+ - Fixed multi not being executed on Node 0.10.x if node_redis not yet ready ([@BridgeAR](https://github.com/BridgeAR))
362
+
363
+ ## v2.2.2 - 14 Oct, 2015
364
+
365
+ Bugfixes
366
+
367
+ - Fixed regular commands not being executed after a .multi until .exec was called ([@BridgeAR](https://github.com/BridgeAR))
368
+
369
+ ## v2.2.1 - 12 Oct, 2015
370
+
371
+ No code change
372
+
373
+ ## v2.2.0 - 12 Oct, 2015 - The peregrino falcon
374
+
375
+ The peregrino falcon is the fasted bird on earth and this is what this release is all about: Increased performance for heavy usage by up to **400%** [sic!] and increased overall performance for any command as well. Please check the benchmarks in the [README.md](README.md) for further details.
376
+
377
+ Features
378
+
379
+ - Added rename_commands options to handle renamed commands from the redis config ([@digmxl](https://github.com/digmxl) & [@BridgeAR](https://github.com/BridgeAR))
380
+ - Added disable_resubscribing option to prevent a client from resubscribing after reconnecting ([@BridgeAR](https://github.com/BridgeAR))
381
+ - Increased performance ([@BridgeAR](https://github.com/BridgeAR))
382
+ - exchanging built in queue with [@petkaantonov](https://github.com/petkaantonov)'s [double-ended queue](https://github.com/petkaantonov/deque)
383
+ - prevent polymorphism
384
+ - optimize statements
385
+ - Added _.batch_ command, similar to .multi but without transaction ([@BridgeAR](https://github.com/BridgeAR))
386
+ - Improved pipelining to minimize the [RTT](http://redis.io/topics/pipelining) further ([@BridgeAR](https://github.com/BridgeAR))
387
+
388
+ Bugfixes
389
+
390
+ - Fixed a javascript parser regression introduced in 2.0 that could result in timeouts on high load. ([@BridgeAR](https://github.com/BridgeAR))
391
+ - I was not able to write a regression test for this, since the error seems to only occur under heavy load with special conditions. So please have a look for timeouts with the js parser, if you use it and report all issues and switch to the hiredis parser in the meanwhile. If you're able to come up with a reproducable test case, this would be even better :)
392
+ - Fixed should_buffer boolean for .exec, .select and .auth commands not being returned and fix a couple special conditions ([@BridgeAR](https://github.com/BridgeAR))
393
+
394
+ If you do not rely on transactions but want to reduce the RTT you can use .batch from now on. It'll behave just the same as .multi but it does not have any transaction and therefor won't roll back any failed commands.<br>
395
+ Both .multi and .batch are from now on going to cache the commands and release them while calling .exec.
396
+
397
+ Please consider using .batch instead of looping through a lot of commands one by one. This will significantly improve your performance.
398
+
399
+ Here are some stats compared to ioredis 1.9.1 (Lenovo T450s i7-5600U):
400
+
401
+ simple set
402
+ 82,496 op/s » ioredis
403
+ 112,617 op/s » node_redis
404
+
405
+ simple get
406
+ 82,015 op/s » ioredis
407
+ 105,701 op/s » node_redis
408
+
409
+ simple get with pipeline
410
+ 10,233 op/s » ioredis
411
+ 26,541 op/s » node_redis (using .batch)
412
+
413
+ lrange 100
414
+ 7,321 op/s » ioredis
415
+ 26,155 op/s » node_redis
416
+
417
+ publish
418
+ 90,524 op/s » ioredis
419
+ 112,823 op/s » node_redis
420
+
421
+ subscribe
422
+ 43,783 op/s » ioredis
423
+ 61,889 op/s » node_redis
424
+
425
+ To conclude: we can proudly say that node_redis is very likely outperforming any other node redis client.
426
+
427
+ Known issues
428
+
429
+ - The pub sub system has some flaws and those will be addressed in the next minor release
430
+
431
+ ## v2.1.0 - Oct 02, 2015
432
+
433
+ Features:
434
+
435
+ - Addded optional flush parameter to `.end`. If set to true, commands fired after using .end are going to be rejected instead of being ignored. (@crispy1989)
436
+ - Addded: host and port can now be provided in a single options object. E.g. redis.createClient({ host: 'localhost', port: 1337, max_attempts: 5 }); (@BridgeAR)
437
+ - Speedup common cases (@BridgeAR)
438
+
439
+ Bugfixes:
440
+
441
+ - Fix argument mutation while using the array notation with the multi constructor (@BridgeAR)
442
+ - Fix multi.hmset key not being type converted if used with an object and key not being a string (@BridgeAR)
443
+ - Fix parser errors not being catched properly (@BridgeAR)
444
+ - Fix a crash that could occur if a redis server does not return the info command as usual #541 (@BridgeAR)
445
+ - Explicitly passing undefined as a callback statement will work again. E.g. client.publish('channel', 'message', undefined); (@BridgeAR)
446
+
447
+ ## v2.0.1 - Sep 24, 2015
448
+
449
+ Bugfixes:
450
+
451
+ - Fix argument mutation while using the array notation in combination with keys / callbacks ([#866](.)). (@BridgeAR)
452
+
453
+ ## v2.0.0 - Sep 21, 2015
454
+
455
+ This is the biggest release that node_redis had since it was released in 2010. A long list of outstanding bugs has been fixed, so we are very happy to present you redis 2.0 and we highly recommend updating as soon as possible.
456
+
457
+ # What's new in 2.0
458
+
459
+ - Implemented a "connection is broken" mode if no connection could be established
460
+ - node_redis no longer throws under any circumstances, preventing it from terminating applications.
461
+ - Multi error handling is now working properly
462
+ - Consistent command behavior including multi
463
+ - Windows support
464
+ - Improved performance
465
+ - A lot of code cleanup
466
+ - Many bug fixes
467
+ - Better user support!
468
+
469
+ ## Features:
470
+
471
+ - Added a "redis connection is broken" mode after reaching max connection attempts / exceeding connection timeout. (@BridgeAR)
472
+ - Added NODE_DEBUG=redis env to activate the debug_mode (@BridgeAR)
473
+ - Added a default connection timeout of 24h instead of never timing out as a default (@BridgeAR)
474
+ - Added: Network errors and other stream errors will from now on include the error code as `err.code` property (@BridgeAR)
475
+ - Added: Errors thrown by redis will now include the redis error code as `err.code` property. (@skeggse & @BridgeAR)
476
+ - Added: Errors thrown by node_redis will now include a `err.command` property for the command used (@BridgeAR)
477
+ - Added new commands and drop support for deprecated _substr_ (@BridgeAR)
478
+ - Added new possibilities how to provide the command arguments (@BridgeAR)
479
+ - The entries in the keyspace of the server_info is now an object instead of a string. (@SinisterLight & @BridgeAR)
480
+ - Small speedup here and there (e.g. by not using .toLowerCase() anymore) (@BridgeAR)
481
+ - Full windows support (@bcoe)
482
+ - Increased coverage by 10% and add a lot of tests to make sure everything works as it should. We now reached 97% :-) (@BridgeAR)
483
+ - Remove dead code, clean up and refactor very old chunks (@BridgeAR)
484
+ - Don't flush the offline queue if reconnecting (@BridgeAR)
485
+ - Emit all errors insteaf of throwing sometimes and sometimes emitting them (@BridgeAR)
486
+ - _auth_pass_ passwords are now checked to be a valid password (@jcppman & @BridgeAR)
487
+
488
+ ## Bug fixes:
489
+
490
+ - Don't kill the app anymore by randomly throwing errors sync instead of emitting them (@BridgeAR)
491
+ - Don't catch user errors anymore occuring in callbacks (no try callback anymore & more fixes for the parser) (@BridgeAR)
492
+ - Early garbage collection of queued items (@dohse)
493
+ - Fix js parser returning errors as strings (@BridgeAR)
494
+ - Do not wrap errors into other errors (@BridgeAR)
495
+ - Authentication failures are now returned in the callback instead of being emitted (@BridgeAR)
496
+ - Fix a memory leak on reconnect (@rahar)
497
+ - Using `send_command` directly may now also be called without the args as stated in the [README.md](./README.md) (@BridgeAR)
498
+ - Fix the multi.exec error handling (@BridgeAR)
499
+ - Fix commands being inconsistent and behaving wrong (@BridgeAR)
500
+ - Channel names with spaces are now properly resubscribed after a reconnection (@pbihler)
501
+ - Do not try to reconnect after the connection timeout has been exceeded (@BridgeAR)
502
+ - Ensure the execution order is observed if using .eval (@BridgeAR)
503
+ - Fix commands not being rejected after calling .quit (@BridgeAR)
504
+ - Fix .auth calling the callback twice if already connected (@BridgeAR)
505
+ - Fix detect_buffers not working in pub sub mode and while monitoring (@BridgeAR)
506
+ - Fix channel names always being strings instead of buffers while return_buffers is true (@BridgeAR)
507
+ - Don't print any debug statements if not asked for (@BridgeAR)
508
+ - Fix a couple small other bugs
509
+
510
+ ## Breaking changes:
511
+
512
+ 1. redis.send_command commands have to be lower case from now on. This does only apply if you use `.send_command` directly instead of the convenient methods like `redis.command`.
513
+ 2. Error messages have changed quite a bit. If you depend on a specific wording please check your application carfully.
514
+ 3. Errors are from now on always either returned if a callback is present or emitted. They won't be thrown (neither sync, nor async).
515
+ 4. The Multi error handling has changed a lot!
516
+
517
+ - All errors are from now on errors instead of strings (this only applied to the js parser).
518
+ - If an error occurs while queueing the commands an EXECABORT error will be returned including the failed commands as `.errors` property instead of an array with errors.
519
+ - If an error occurs while executing the commands and that command has a callback it'll return the error as first parameter (`err, undefined` instead of `null, undefined`).
520
+ - All the errors occuring while executing the commands will stay in the result value as error instance (if you used the js parser before they would have been strings). Be aware that the transaction won't be aborted if those error occurr!
521
+ - If `multi.exec` does not have a callback and an EXECABORT error occurrs, it'll emit that error instead.
522
+
523
+ 5. If redis can't connect to your redis server it'll give up after a certain point of failures (either max connection attempts or connection timeout exceeded). If that is the case it'll emit an CONNECTION_BROKEN error. You'll have to initiate a new client to try again afterwards.
524
+ 6. The offline queue is not flushed anymore on a reconnect. It'll stay until node_redis gives up trying to reach the server or until you close the connection.
525
+ 7. Before this release node_redis catched user errors and threw them async back. This is not the case anymore! No user behavior of what so ever will be tracked or catched.
526
+ 8. The keyspace of `redis.server_info` (db0...) is from now on an object instead of an string.
527
+
528
+ NodeRedis also thanks @qdb, @tobek, @cvibhagool, @frewsxcv, @davidbanham, @serv, @vitaliylag, @chrishamant, @GamingCoder and all other contributors that I may have missed for their contributions!
529
+
530
+ From now on we'll push new releases more frequently out and fix further long outstanding things and implement new features.
531
+
532
+ <hr>
533
+
534
+ ## v1.0.0 - Aug 30, 2015
535
+
536
+ - Huge issue and pull-request cleanup. Thanks Blain! (@blainsmith)
537
+ - [#658](https://github.com/NodeRedis/node_redis/pull/658) Client now parses URL-format connection strings (e.g., redis://foo:pass@127.0.0.1:8080) (@kuwabarahiroshi)
538
+ - [#749](https://github.com/NodeRedis/node_redis/pull/749) Fix reconnection bug when client is in monitoring mode (@danielbprice)
539
+ - [#786](https://github.com/NodeRedis/node_redis/pull/786) Refactor createClient. Fixes #651 (@BridgeAR)
540
+ - [#793](https://github.com/NodeRedis/node_redis/pull/793) Refactor tests and improve test coverage (@erinspice, @bcoe)
541
+ - [#733](https://github.com/NodeRedis/node_redis/pull/733) Fixes detect_buffers functionality in the context of exec. Fixes #732, #263 (@raydog)
542
+ - [#785](https://github.com/NodeRedis/node_redis/pull/785) Tiny speedup by using 'use strict' (@BridgeAR)
543
+ - Fix extraneous error output due to pubsub tests (Mikael Kohlmyr)
544
+
545
+ ## v0.12.1 - Aug 10, 2014
546
+
547
+ - Fix IPv6/IPv4 family selection in node 0.11+ (Various)
548
+
549
+ ## v0.12.0 - Aug 9, 2014
550
+
551
+ - Fix unix socket support (Jack Tang)
552
+ - Improve createClient argument handling (Jack Tang)
553
+
554
+ ## v0.11.0 - Jul 10, 2014
555
+
556
+ - IPv6 Support. (Yann Stephan)
557
+ - Revert error emitting and go back to throwing errors. (Bryce Baril)
558
+ - Set socket_keepalive to prevent long-lived client timeouts. (mohit)
559
+ - Correctly reset retry timer. (ouotuo)
560
+ - Domains protection from bad user exit. (Jake Verbaten)
561
+ - Fix reconnection socket logic to prevent misqueued entries. (Iain Proctor)
562
+
563
+ ## v0.10.3 - May 22, 2014
564
+
565
+ - Update command list to match Redis 2.8.9 (Charles Feng)
566
+
567
+ ## v0.10.2 - May 18, 2014
568
+
569
+ - Better binary key handling for HGETALL. (Nick Apperson)
570
+ - Fix test not resetting `error` handler. (CrypticSwarm)
571
+ - Fix SELECT error semantics. (Bryan English)
572
+
573
+ ## v0.10.1 - February 17, 2014
574
+
575
+ - Skip plucking redis version from the INFO stream if INFO results weren't provided. (Robert Sköld)
576
+
577
+ ## v0.10.0 - December 21, 2013
578
+
579
+ - Instead of throwing errors asynchronously, emit errors on client. (Bryce Baril)
580
+
581
+ ## v0.9.2 - December 15, 2013
582
+
583
+ - Regenerate commands for new 2.8.x Redis commands. (Marek Ventur)
584
+ - Correctly time reconnect counts when using 'auth'. (William Hockey)
585
+
586
+ ## v0.9.1 - November 23, 2013
587
+
588
+ - Allow hmset to accept numeric keys. (Alex Stokes)
589
+ - Fix TypeError for multiple MULTI/EXEC errors. (Kwangsu Kim)
590
+
591
+ ## v0.9.0 - October 17, 2013
592
+
593
+ - Domains support. (Forrest L Norvell)
594
+
595
+ ## v0.8.6 - October 2, 2013
596
+
597
+ - If error is already an Error, don't wrap it in another Error. (Mathieu M-Gosselin)
598
+ - Fix retry delay logic (Ian Babrou)
599
+ - Return Errors instead of strings where Errors are expected (Ian Babrou)
600
+ - Add experimental `.unref()` method to RedisClient (Bryce Baril / Olivier Lalonde)
601
+ - Strengthen checking of reply to prevent conflating "message" or "pmessage" fields with pub_sub replies. (Bryce Baril)
602
+
603
+ ## v0.8.5 - September 26, 2013
604
+
605
+ - Add `auth_pass` option to connect and immediately authenticate (Henrik Peinar)
606
+
607
+ ## v0.8.4 - June 24, 2013
608
+
609
+ Many contributed features and fixes, including:
610
+
611
+ - Ignore password set if not needed. (jbergknoff)
612
+ - Improved compatibility with 0.10.X for tests and client.end() (Bryce Baril)
613
+ - Protect connection retries from application exceptions. (Amos Barreto)
614
+ - Better exception handling for Multi/Exec (Thanasis Polychronakis)
615
+ - Renamed pubsub mode to subscriber mode (Luke Plaster)
616
+ - Treat SREM like SADD when passed an array (Martin Ciparelli)
617
+ - Fix empty unsub/punsub TypeError (Jeff Barczewski)
618
+ - Only attempt to run a callback if it one was provided (jifeng)
619
+
620
+ ## v0.8.3 - April 09, 2013
621
+
622
+ Many contributed features and fixes, including:
623
+
624
+ - Fix some tests for Node.js version 0.9.x+ changes (Roman Ivanilov)
625
+ - Fix error when commands submitted after idle event handler (roamm)
626
+ - Bypass Redis for no-op SET/SETEX commands (jifeng)
627
+ - Fix HMGET + detect_buffers (Joffrey F)
628
+ - Fix CLIENT LOAD functionality (Jonas Dohse)
629
+ - Add percentage outputs to diff_multi_bench_output.js (Bryce Baril)
630
+ - Add retry_max_delay option (Tomasz Durka)
631
+ - Fix parser off-by-one errors with nested multi-bulk replies (Bryce Baril)
632
+ - Prevent parser from sinking application-side exceptions (Bryce Baril)
633
+ - Fix parser incorrect buffer skip when parsing multi-bulk errors (Bryce Baril)
634
+ - Reverted previous change with throwing on non-string values with HMSET (David Trejo)
635
+ - Fix command queue sync issue when using pubsub (Tom Leach)
636
+ - Fix compatibility with two-word Redis commands (Jonas Dohse)
637
+ - Add EVAL with array syntax (dmoena)
638
+ - Fix tests due to Redis reply order changes in 2.6.5+ (Bryce Baril)
639
+ - Added a test for the SLOWLOG command (Nitesh Sinha)
640
+ - Fix SMEMBERS order dependency in test broken by Redis changes (Garrett Johnson)
641
+ - Update commands for new Redis commands (David Trejo)
642
+ - Prevent exception from SELECT on subscriber reconnection (roamm)
643
+
644
+ ## v0.8.2 - November 11, 2012
645
+
646
+ Another version bump because 0.8.1 didn't get applied properly for some mysterious reason.
647
+ Sorry about that.
648
+
649
+ Changed name of "faster" parser to "javascript".
650
+
651
+ ## v0.8.1 - September 11, 2012
652
+
653
+ Important bug fix for null responses (Jerry Sievert)
654
+
655
+ ## v0.8.0 - September 10, 2012
656
+
657
+ Many contributed features and fixes, including:
658
+
659
+ - Pure JavaScript reply parser that is usually faster than hiredis (Jerry Sievert)
660
+ - Remove hiredis as optionalDependency from package.json. It still works if you want it.
661
+ - Restore client state on reconnect, including select, subscribe, and monitor. (Ignacio Burgueño)
662
+ - Fix idle event (Trae Robrock)
663
+ - Many documentation improvements and bug fixes (David Trejo)
664
+
665
+ ## v0.7.2 - April 29, 2012
666
+
667
+ Many contributed fixes. Thank you, contributors.
668
+
669
+ - [GH-190] - pub/sub mode fix (Brian Noguchi)
670
+ - [GH-165] - parser selection fix (TEHEK)
671
+ - numerous documentation and examples updates
672
+ - auth errors emit Errors instead of Strings (David Trejo)
673
+
674
+ ## v0.7.1 - November 15, 2011
675
+
676
+ Fix regression in reconnect logic.
677
+
678
+ Very much need automated tests for reconnection and queue logic.
679
+
680
+ ## v0.7.0 - November 14, 2011
681
+
682
+ Many contributed fixes. Thanks everybody.
683
+
684
+ - [GH-127] - properly re-initialize parser on reconnect
685
+ - [GH-136] - handle passing undefined as callback (Ian Babrou)
686
+ - [GH-139] - properly handle exceptions thrown in pub/sub event handlers (Felix Geisendörfer)
687
+ - [GH-141] - detect closing state on stream error (Felix Geisendörfer)
688
+ - [GH-142] - re-select database on reconnection (Jean-Hugues Pinson)
689
+ - [GH-146] - add sort example (Maksim Lin)
690
+
691
+ Some more goodies:
692
+
693
+ - Fix bugs with node 0.6
694
+ - Performance improvements
695
+ - New version of `multi_bench.js` that tests more realistic scenarios
696
+ - [GH-140] - support optional callback for subscribe commands
697
+ - Properly flush and error out command queue when connection fails
698
+ - Initial work on reconnection thresholds
699
+
700
+ ## v0.6.7 - July 30, 2011
701
+
702
+ (accidentally skipped v0.6.6)
703
+
704
+ Fix and test for [GH-123]
705
+
706
+ Passing an Array as as the last argument should expand as users
707
+ expect. The old behavior was to coerce the arguments into Strings,
708
+ which did surprising things with Arrays.
709
+
710
+ ## v0.6.5 - July 6, 2011
711
+
712
+ Contributed changes:
713
+
714
+ - Support SlowBuffers (Umair Siddique)
715
+ - Add Multi to exports (Louis-Philippe Perron)
716
+ - Fix for drain event calculation (Vladimir Dronnikov)
717
+
718
+ Thanks!
719
+
720
+ ## v0.6.4 - June 30, 2011
721
+
722
+ Fix bug with optional callbacks for hmset.
723
+
724
+ ## v0.6.2 - June 30, 2011
725
+
726
+ Bugs fixed:
727
+
728
+ - authentication retry while server is loading db (danmaz74) [GH-101]
729
+ - command arguments processing issue with arrays
730
+
731
+ New features:
732
+
733
+ - Auto update of new commands from redis.io (Dave Hoover)
734
+ - Performance improvements and backpressure controls.
735
+ - Commands now return the true/false value from the underlying socket write(s).
736
+ - Implement command_queue high water and low water for more better control of queueing.
737
+
738
+ See `examples/backpressure_drain.js` for more information.
739
+
740
+ ## v0.6.1 - June 29, 2011
741
+
742
+ Add support and tests for Redis scripting through EXEC command.
743
+
744
+ Bug fix for monitor mode. (forddg)
745
+
746
+ Auto update of new commands from redis.io (Dave Hoover)
747
+
748
+ ## v0.6.0 - April 21, 2011
749
+
750
+ Lots of bugs fixed.
751
+
752
+ - connection error did not properly trigger reconnection logic [GH-85]
753
+ - client.hmget(key, [val1, val2]) was not expanding properly [GH-66]
754
+ - client.quit() while in pub/sub mode would throw an error [GH-87]
755
+ - client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
756
+ - unsubscribe before subscribe would make things very confused [GH-88]
757
+ - Add BRPOPLPUSH [GH-79]
758
+
759
+ ## v0.5.11 - April 7, 2011
760
+
761
+ Added DISCARD
762
+
763
+ I originally didn't think DISCARD would do anything here because of the clever MULTI interface, but somebody
764
+ pointed out to me that DISCARD can be used to flush the WATCH set.
765
+
766
+ ## v0.5.10 - April 6, 2011
767
+
768
+ Added HVALS
769
+
770
+ ## v0.5.9 - March 14, 2011
771
+
772
+ Fix bug with empty Array arguments - Andy Ray
773
+
774
+ ## v0.5.8 - March 14, 2011
775
+
776
+ Add `MONITOR` command and special monitor command reply parsing.
777
+
778
+ ## v0.5.7 - February 27, 2011
779
+
780
+ Add magical auth command.
781
+
782
+ Authentication is now remembered by the client and will be automatically sent to the server
783
+ on every connection, including any reconnections.
784
+
785
+ ## v0.5.6 - February 22, 2011
786
+
787
+ Fix bug in ready check with `return_buffers` set to `true`.
788
+
789
+ Thanks to Dean Mao and Austin Chau.
790
+
791
+ ## v0.5.5 - February 16, 2011
792
+
793
+ Add probe for server readiness.
794
+
795
+ When a Redis server starts up, it might take a while to load the dataset into memory.
796
+ During this time, the server will accept connections, but will return errors for all non-INFO
797
+ commands. Now node_redis will send an INFO command whenever it connects to a server.
798
+ If the info command indicates that the server is not ready, the client will keep trying until
799
+ the server is ready. Once it is ready, the client will emit a "ready" event as well as the
800
+ "connect" event. The client will queue up all commands sent before the server is ready, just
801
+ like it did before. When the server is ready, all offline/non-ready commands will be replayed.
802
+ This should be backward compatible with previous versions.
803
+
804
+ To disable this ready check behavior, set `options.no_ready_check` when creating the client.
805
+
806
+ As a side effect of this change, the key/val params from the info command are available as
807
+ `client.server_options`. Further, the version string is decomposed into individual elements
808
+ in `client.server_options.versions`.
809
+
810
+ ## v0.5.4 - February 11, 2011
811
+
812
+ Fix excess memory consumption from Queue backing store.
813
+
814
+ Thanks to Gustaf Sjöberg.
815
+
816
+ ## v0.5.3 - February 5, 2011
817
+
818
+ Fix multi/exec error reply callback logic.
819
+
820
+ Thanks to Stella Laurenzo.
821
+
822
+ ## v0.5.2 - January 18, 2011
823
+
824
+ Fix bug where unhandled error replies confuse the parser.
825
+
826
+ ## v0.5.1 - January 18, 2011
827
+
828
+ Fix bug where subscribe commands would not handle redis-server startup error properly.
829
+
830
+ ## v0.5.0 - December 29, 2010
831
+
832
+ Some bug fixes:
833
+
834
+ - An important bug fix in reconnection logic. Previously, reply callbacks would be invoked twice after
835
+ a reconnect.
836
+ - Changed error callback argument to be an actual Error object.
837
+
838
+ New feature:
839
+
840
+ - Add friendly syntax for HMSET using an object.
841
+
842
+ ## v0.4.1 - December 8, 2010
843
+
844
+ Remove warning about missing hiredis. You probably do want it though.
845
+
846
+ ## v0.4.0 - December 5, 2010
847
+
848
+ Support for multiple response parsers and hiredis C library from Pieter Noordhuis.
849
+ Return Strings instead of Buffers by default.
850
+ Empty nested mb reply bug fix.
851
+
852
+ ## v0.3.9 - November 30, 2010
853
+
854
+ Fix parser bug on failed EXECs.
855
+
856
+ ## v0.3.8 - November 10, 2010
857
+
858
+ Fix for null MULTI response when WATCH condition fails.
859
+
860
+ ## v0.3.7 - November 9, 2010
861
+
862
+ Add "drain" and "idle" events.
863
+
864
+ ## v0.3.6 - November 3, 2010
865
+
866
+ Add all known Redis commands from Redis master, even ones that are coming in 2.2 and beyond.
867
+
868
+ Send a friendlier "error" event message on stream errors like connection refused / reset.
869
+
870
+ ## v0.3.5 - October 21, 2010
871
+
872
+ A few bug fixes.
873
+
874
+ - Fixed bug with `nil` multi-bulk reply lengths that showed up with `BLPOP` timeouts.
875
+ - Only emit `end` once when connection goes away.
876
+ - Fixed bug in `test.js` where driver finished before all tests completed.
877
+
878
+ ## unversioned wasteland
879
+
880
+ See the git history for what happened before.