1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-04 15:02:09 +03:00

Fix: XAUTOCLAIM after a TRIM with pending messages returns nil (#2565)

* fix(client): XCLAIM & XAUTOCLAIM after a TRIM might return nils

* fix(client): Fix race condition in specs

* revert test utils changes

* make tests faster

---------

Co-authored-by: Leibale Eidelman <me@leibale.com>
This commit is contained in:
Charley DAVID
2023-09-19 23:37:16 +02:00
committed by GitHub
parent 4ec97be4f0
commit e00041e0eb
6 changed files with 154 additions and 27 deletions

View File

@@ -9,6 +9,7 @@ import {
transformStringNumberInfinityArgument,
transformTuplesReply,
transformStreamMessagesReply,
transformStreamMessagesNullReply,
transformStreamsMessagesReply,
transformSortedSetWithScoresReply,
pushGeoCountArgument,
@@ -219,6 +220,38 @@ describe('Generic Transformers', () => {
);
});
it('transformStreamMessagesNullReply', () => {
assert.deepEqual(
transformStreamMessagesNullReply([null, ['0-0', ['0key', '0value']]]),
[null, {
id: '0-0',
message: Object.create(null, {
'0key': {
value: '0value',
configurable: true,
enumerable: true
}
})
}]
);
});
it('transformStreamMessagesNullReply', () => {
assert.deepEqual(
transformStreamMessagesNullReply([null, ['0-1', ['11key', '11value']]]),
[null, {
id: '0-1',
message: Object.create(null, {
'11key': {
value: '11value',
configurable: true,
enumerable: true
}
})
}]
);
});
describe('transformStreamsMessagesReply', () => {
it('null', () => {
assert.equal(