Skip to content

Commit de0a962

Browse files
author
Ruben Bridgewater
committed
Fire the individual original callbacks when using transactions
Fixes #1089
1 parent ed57f44 commit de0a962

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
## v.2.6.2 - 16 Jun, 2016
5+
6+
Bugfixes
7+
8+
- Fixed individual callbacks of a transaction not being called (2.6.0 regression)
9+
410
## v.2.6.1 - 02 Jun, 2016
511

612
Bugfixes

lib/multi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function pipeline_transaction_command (self, command_obj, index) {
3636
// Keep track of who wants buffer responses:
3737
// By the time the callback is called the command_obj got the buffer_args attribute attached
3838
self.wants_buffers[index] = command_obj.buffer_args;
39+
command_obj.callback = tmp;
3940
};
4041
self._client.internal_send_command(command_obj);
4142
}

test/multi.spec.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ describe("The 'multi' method", function () {
393393
var arr2 = ['some manner of key', 'otherTypes'];
394394
var arr3 = [5768, 'multibarx', 'multifoox'];
395395
var arr4 = ['mset', [578, 'multibar'], helper.isString('OK')];
396+
var called = false;
396397
client.multi([
397398
arr4,
398399
[['mset', 'multifoo2', 'multibar2', 'multifoo3', 'multibar3'], helper.isString('OK')],
@@ -411,8 +412,10 @@ describe("The 'multi' method", function () {
411412
.mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) {
412413
assert(res[0], 'multifoo3');
413414
assert(res[1], 'multifoo');
415+
called = true;
414416
})
415417
.exec(function (err, replies) {
418+
assert(called);
416419
assert.equal(arr.length, 3);
417420
assert.equal(arr2.length, 2);
418421
assert.equal(arr3.length, 3);

0 commit comments

Comments
 (0)