Skip to content

Commit

Permalink
Fire the individual original callbacks when using transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben Bridgewater committed Jun 16, 2016
1 parent ed57f44 commit de0a962
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

## v.2.6.2 - 16 Jun, 2016

Bugfixes

- Fixed individual callbacks of a transaction not being called (2.6.0 regression)

## v.2.6.1 - 02 Jun, 2016

Bugfixes
Expand Down
1 change: 1 addition & 0 deletions lib/multi.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function pipeline_transaction_command (self, command_obj, index) {
// Keep track of who wants buffer responses:
// By the time the callback is called the command_obj got the buffer_args attribute attached
self.wants_buffers[index] = command_obj.buffer_args;
command_obj.callback = tmp;
};
self._client.internal_send_command(command_obj);
}
Expand Down
3 changes: 3 additions & 0 deletions test/multi.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ describe("The 'multi' method", function () {
var arr2 = ['some manner of key', 'otherTypes'];
var arr3 = [5768, 'multibarx', 'multifoox'];
var arr4 = ['mset', [578, 'multibar'], helper.isString('OK')];
var called = false;
client.multi([
arr4,
[['mset', 'multifoo2', 'multibar2', 'multifoo3', 'multibar3'], helper.isString('OK')],
Expand All @@ -411,8 +412,10 @@ describe("The 'multi' method", function () {
.mget('multifoo2', ['multifoo3', 'multifoo'], function (err, res) {
assert(res[0], 'multifoo3');
assert(res[1], 'multifoo');
called = true;
})
.exec(function (err, replies) {
assert(called);
assert.equal(arr.length, 3);
assert.equal(arr2.length, 2);
assert.equal(arr3.length, 3);
Expand Down

0 comments on commit de0a962

Please sign in to comment.