1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-12 21:21:15 +03:00
Commit Graph

343 Commits

Author SHA1 Message Date
GitHub Action
c7c387a3a0 Release client@5.10.0 2025-11-19 16:28:06 +00:00
Nikolay Karadzhov
a245ef4494 fix(xreadgroup): dont parse number props (#3133)
Initially, there was a bug in the server where the two additional props were
returned as string instead of number. This should now be fixed in the GA, so
no need to parse to Number anymore.
2025-11-19 14:16:52 +02:00
Nikolay Karadzhov
ff91ecef81 chore(tests): bump test container version 8.4.0 (#3139) 2025-11-19 13:35:45 +02:00
Nikolay Karadzhov
539780caa8 bump test container version 8.4-GA-pre.3 (#3136)
* bump test container version 8.4-GA-pre.2

* chore(tests): bump test container version 8.4-GA-pre.3
2025-11-18 12:20:23 +02:00
Nikolay Karadzhov
c9f8cbcad5 chore: mark 8.4 features as experimental (#3134) 2025-11-11 13:03:19 +02:00
Nikolay Karadzhov
f8841c880e fix(socket): prevent false-ready state when socket errors during handshake (#3128)
* fix(socket): prevent false-ready state when socket errors during handshake

Fixes race condition where async socket errors during connection
handshake don't trigger reconnection. Validates socket state after
initiator completes to catch errors swallowed by command handlers.

fixes: #3108

* remove comments
2025-11-10 19:34:26 +02:00
Nikolay Karadzhov
100c0394dc fix(release): bump dist/package.json version (#3125)
Currently, the release process incorrectly leaves the dist/package.json's version
to be the old version. This in turn makes the client setinfo lib-ver command to
send wrong version to redis.
Fix: use the release-it/bumper package to update dist/package.json with the
correct version upon release.

fixes: #3118
2025-11-04 10:25:27 +02:00
Nikolay Karadzhov
568d60dbaa chore(tests): bump test container version 8.4-RC1-pre.2 (#3126) 2025-11-03 17:22:03 +02:00
Trofymenko Vladyslav
dae47b4820 feat(client): add latency histogram (#3099)
* add latency histogram command, tests (##1955)
2025-11-03 14:05:58 +02:00
Pavel Pashov
38bfaa7c90 feat(client): add msetex command and tests for it (#3116) 2025-11-03 13:53:18 +02:00
Pavel Pashov
2fdb6def45 feat(client): add CAS/CAD, DELEX, DIGEST support (#3123)
* feat: add digest command and tests

* feat: add delex command and tests

* feat: add more conditional options to SET update tests
2025-11-03 13:53:01 +02:00
Nikolay Karadzhov
5a0a06df69 feat(xreadgroup): add claim attribute (#3122)
* feat(xreadgroup): add claim attribute

the CLAIM attribute can be used to instruct redis to return
PEL ( Pending Entries List ) entries with their respective
deliveries and ms since last delivery

* remove m01 from test matrix

* add jsdoc
2025-11-03 11:59:49 +02:00
Nikolay Karadzhov
9c9a9732fb chore(tests): bump test container version 8.4-RC1-pre (#3115) 2025-10-30 13:16:56 +02:00
GitHub Action
483fd9d16a Release client@5.9.0 2025-10-23 14:03:35 +00:00
GitHub Action
f9d1bc0b18 Release client@5.9.0-beta.3 2025-10-21 14:01:00 +00:00
Nikolay Karadzhov
1cda848393 fix(cmd): PUBSUB_NUMSUB return count as number (#3103)
fixes: #3102
2025-10-21 11:37:22 +03:00
Bob Burden III
d7c6544d3a fix: multi-byte character corruption when converting Buffers to strings (#3100)
* add tests for multi-byte character buffer
* support multi-byte characters when decoding buffers

fixes: #2993
2025-10-13 13:19:45 +03:00
Nikolay Karadzhov
96d6445d66 fix(ssubscribe): properly resubscribe in case of shard failover (#3098)
* fix(ssubscribe): properly resubscribe in case of shard failover

1) when RE failover happens, there is a disconnect
2) affected Client reconnects and tries to resubscribe all existing listeners
ISSUE #1: CROSSSLOT Error - client was doing ssubscribe ch1 ch2.. chN which, after the failover could result in CROSSSLOT ( naturally, becasuse now some slots could be owned by other shards )
FIX: send one ssubscribe command per channel instead of one ssubscribe for all channels
ISSUE #2: MOVED Error - some/all of the channels might be moved somewhere else
FIX: 1: Propagate the error to the Cluster. 2: Cluster rediscovers topology.
3: Cluster resubscribes all listeners of the failed client ( possibly some/all of those will end up in a different client after the rediscovery ) 

fixes: #2902
2025-10-13 11:59:08 +03:00
Trofymenko Vladyslav
bd11e382d0 feat: add cluster/node events (#1855) (#3083)
* add cluster/node events
* add test for cluster events positive branch
* add cluster events docs section

fixes: #1855

---------

Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
2025-10-09 16:06:57 +03:00
blackman
d6d8d8e8ed fix(client): export various enum values (#3074)
Certain command parameter enums, specifically ClientKillFilters for the CLIENT KILL command, were not publicly exported by the @redis/client package. The purpose of this change is to make the ClientKillFilters enum accessible to all package consumers, eliminating the need for users to rely on an unstable internal import path.

This matters because it provides a reliable and supported way for developers to use commands that require these enums, improving the package's usability and API stability.

fixes: #2805



Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
2025-10-08 16:47:57 +03:00
Stef Schoonderwoerd
5b63382e6a feat(client): Emit invalidate events from client (#3076)
* add emitInvalidate option

* Add documentation for event

* Re-write emitInvalidate logic

* Fix issues after merge

---------

Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
2025-10-07 12:43:38 +03:00
Nikolay Karadzhov
bab26b08a7 test(maint): touch up wrong assertions (#3096) 2025-10-07 12:26:13 +03:00
Nikolay Karadzhov
adb19c5c5f tests: Adjust scenario tests according to latest maint naming changes (#3090)
* rename maint options according to the latest client options
* adjust env variables
cae repo uses RE_FAULT_INJECTOR_URL for fault injector
DATABASE_NAME is needed to choose from the many databases in cae
* fix connection cleanup test
2025-10-06 18:30:18 +03:00
Bobby I.
0438865b8a chore: Update default Redis version to 8.4-M01-pre in tests (#3092) 2025-10-06 13:53:37 +03:00
Vuong Ngo (Viktor)
73413e086c fix: resolve doubly linked list push issue (#3085)
* fix redis sentinel failover

* fix: resolve doubly linked list push issue

* fix semicolon syntax

* correctly set the removed node ref

* fix linked list node iterator

* revert push logic and refactor remove logic

* add linked list tests
2025-10-02 13:39:39 +03:00
GitHub Action
3b0fb9a161 Release client@5.9.0-beta.2 2025-10-01 13:46:33 +00:00
Pavel Pashov
e588eab249 fix: add typed/untyped mode support for multi-commands (#3084) 2025-10-01 16:33:22 +03:00
GitHub Action
e7ff3b5142 Release client@5.9.0-beta.1 2025-09-26 08:52:43 +00:00
Nikolay Karadzhov
e138cbd05b fix(init): option parsing (#3086)
* refactor(maint): rename options

* fix(init): option parsing

* refactor(client): #options cannot be undefined
2025-09-23 14:24:37 +03:00
Pavel Pashov
b97bbbe8c6 refactor(test): improve test scenario reliability and maintainability (#3077)
* refactor(test): improve test scenario reliability and maintainability

* tests: add resp3 check test (#1)

* test: refactor connection handoff tests with enhanced spy utility (#2)

* test: add comprehensive push notification disabled scenarios (#3)

* tests: add params config tests (#4)

* tests: add feature enablement tests (#5)

---------

Co-authored-by: Nikolay Karadzhov <nikolay.karadzhov@redis.com>
2025-09-18 12:45:55 +03:00
Nikolay Karadzhov
6eed1ee7ad fix(cluster): prevent infinite loop (#3078)
getRandomNode could end up in an infinite loop if
this.masters is empty and this.replicas is empty.

fixes: #3075
2025-09-12 14:47:57 +03:00
GitHub Action
550767e3ae Release client@5.9.0-beta.0 2025-09-10 09:04:19 +00:00
Nikolay Karadzhov
208a0d250f Hitless upgrades (#3021)
* feat(errors): Add specialized timeout error types for maintenance scenarios

- Added `SocketTimeoutDuringMaintananceError`, a subclass of `TimeoutError`, to handle socket timeouts during maintenance.
- Added `CommandTimeoutDuringMaintenanceError`, another subclass of `TimeoutError`, to address command write timeouts during maintenance.

* feat(linked-list): Add EmptyAwareSinglyLinkedList and enhance DoublyLinkedList functionality

- Introduced `EmptyAwareSinglyLinkedList`, a subclass of `SinglyLinkedList` that emits an `empty` event when the list becomes empty due to `reset`, `shift`, or `remove` operations.
- Added `nodes()` iterator method to `DoublyLinkedList` for iterating over nodes directly.
- Enhanced unit tests for `DoublyLinkedList` and `SinglyLinkedList` to cover edge cases and new functionality.
- Added comprehensive tests for `EmptyAwareSinglyLinkedList` to validate `empty` event emission under various scenarios.
- Improved code formatting and consistency.

* refactor(commands-queue): Improve push notification handling

- Replaced `setInvalidateCallback` with a more flexible `addPushHandler` method, allowing multiple handlers for push notifications.
- Introduced the `PushHandler` type to standardize push notification processing.
- Refactored `RedisCommandsQueue` to use a `#pushHandlers` array, enabling dynamic and modular handling of push notifications.
- Updated `RedisClient` to leverage the new handler mechanism for `invalidate` push notifications, simplifying and decoupling logic.

* feat(commands-queue): Add method to wait for in-flight commands to complete

- Introduced `waitForInflightCommandsToComplete` method to asynchronously wait for all in-flight commands to finish processing.
- Utilized the `empty` event from `#waitingForReply` to signal when all commands have been completed.

* feat(commands-queue): Introduce maintenance mode support for commands-queue

- Added `#maintenanceCommandTimeout` and `setMaintenanceCommandTimeout` method to dynamically adjust command timeouts during maintenance

* refator(client): Extract socket event listener setup into helper method

* refactor(socket): Add maintenance mode support and dynamic timeout handling

- Added `#maintenanceTimeout` and `setMaintenanceTimeout` method to dynamically adjust socket timeouts during maintenance.

* feat(client): Add Redis Enterprise maintenance configuration options

- Added `maintPushNotifications` option to control how the client handles Redis Enterprise maintenance push notifications (`disabled`, `enabled`, `au
to`).
- Added `maintMovingEndpointType` option to specify the endpoint type for reconnecting during a MOVING notification (`auto`, `internal-ip`, `external-ip`,
etc.).
- Added `maintRelaxedCommandTimeout` option to define a relaxed timeout for commands during maintenance.
- Added `maintRelaxedSocketTimeout` option to define a relaxed timeout for the socket during maintenance.
- Enforced RESP3 requirement for maintenance-related features (`maintPushNotifications`).

* feat(client): Add socket helpers and pause mechanism

- Introduced `#paused` flag with corresponding `_pause` and `_unpause` methods to
temporarily halt writing commands to the socket during maintenance windows.
- Updated `#write` method to respect the `#paused` flag, preventing new commands from being written during maintenance.
- Added `_ejectSocket` method to safely detach from and return the current socket
- Added `_insertSocket` method to receive and start using a new socket

* feat(client): Add Redis Enterprise maintenance handling capabilities

- Introduced `EnterpriseMaintenanceManager` to manage Redis Enterprise maintenance events and push notifications.
- Integrated `EnterpriseMaintenanceManager` into `RedisClient` to handle maintenance push notifications and manage socket transitions.
- Implemented graceful handling of MOVING, MIGRATING, and FAILOVER push notifications, including socket replacement and timeout adjustments.


* test: add E2E test infrastructure for Redis maintenance scenarios

* test: add E2E tests for Redis Enterprise maintenance timeout handling (#3)

* test: add connection handoff test


---------

Co-authored-by: Pavel Pashov <pavel.pashov@redis.com>
Co-authored-by: Pavel Pashov <60297174+PavelPashov@users.noreply.github.com>
2025-09-10 11:05:37 +03:00
blackman
1d824df9e1 feat: add LATENCY_RESET command (#3047) 2025-08-27 18:10:15 +03:00
Nikolay Karadzhov
672246dbd2 fix(ts): use all commands in cluster type (#3065)
RedisClusterType was using some type restrictions to
hide some commands based on its properties. In reality,
all commands should be exposed to user ( as in v4 ).

fixes #3064
2025-08-26 16:35:45 +03:00
GitHub Action
2e66012099 Release client@5.8.2 2025-08-20 08:33:04 +00:00
Nikolay Karadzhov
e347d566cb fix(sentinel): properly pass reconnectStrategy (#3063)
Properly pass reconnectStrategy to master/replica nodes.
Before that strategies passed in the nodeClientOptions.socket
object were ignored.

fixes #3061
2025-08-20 11:11:34 +03:00
Nikolay Karadzhov
d5423b93d6 chore(tests): bump test container version 8.2.1-pre (#3057) 2025-08-18 11:32:41 +03:00
Manuel Spigolon
ed6aca7d03 fix(ts): xtrim threshold accepts string (#3058)
* fix(ts): xtrim threshold accepts string

* test: check MINID with text id
2025-08-18 11:22:44 +03:00
Arek W
82847fb92c fix: Stop erasing ErrorReply stack (#3050)
It was very difficult to debug `ErrorReply` errors due to `error.stack` being erased.
Given this restores standard JS Error behaviour, I have not added any tests.
2025-08-14 10:42:36 +03:00
GitHub Action
883375cf4d Release client@5.8.1 2025-08-13 06:22:15 +00:00
Pavel Pashov
68cebf7f6e fix: parse database from Redis URL (#3052) 2025-08-13 08:51:30 +03:00
Nikolay Karadzhov
2f10632450 fix(commands): expire, expireAt are not readonly (#3045)
fixes #3044
2025-08-06 09:50:19 +03:00
Nikolay Karadzhov
6406172ea8 chore(tests): bump test container version 8.2 (#3046) 2025-08-06 09:49:52 +03:00
GitHub Action
de5e916e05 Release client@5.8.0 2025-08-05 09:57:55 +00:00
Igor Loskutov
0f709d01c5 fix: createClient url+tls invariant violation check (#2835) 2025-08-05 10:12:10 +03:00
Pavel Pashov
66638fc903 Add support svs vamana index creation (#3025)
* feat(search): add SVS-VAMANA vector index algorithm support

- Add VAMANA algorithm with compression and tuning parameters
- Include comprehensive test coverage for various configurations
- Fix parameter validation to handle falsy values correctly

* feat(search): add additional VAMANA compression algorithms

- Add LVQ4, LVQ4x4, LVQ4x8, LeanVec4x8, and LeanVec8x8 compression options
- Update test to use LeanVec4x8 compression algorithm

* chore: update Redis version from 8.2-rc1 to 8.2-rc2-pre
2025-08-04 12:07:18 +03:00
GitHub Action
facc91847e Release client@5.7.0 2025-07-31 13:39:03 +00:00
Pavel Pashov
5f09e4a8a5 feat: add EPSILON parameter support to VSIM command (#3041) 2025-07-31 15:11:51 +03:00
Nikolay Karadzhov
d8e14fa4fe fix(scan): remove console.logs (#3038)
fixes #3037
2025-07-28 14:54:50 +03:00