Skip to content

Commit a80ff9b

Browse files
mcfarljwstephenplusplus
authored andcommitted
datastore: return base64 string for a nextQuery startVal
1 parent fc111c1 commit a80ff9b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/datastore/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ DatastoreRequest.prototype.runQuery = function(query, callback) {
465465
var offset = query.offsetVal === -1 ? 0 : query.offsetVal;
466466
var nextOffset = offset - resp.batch.skippedResults;
467467
nextQuery = extend(true, new Query(), query);
468-
nextQuery.start(endCursor).offset(nextOffset);
468+
nextQuery.start(endCursor.toString('base64')).offset(nextOffset);
469469
}
470470

471471
if (notFinished) {

test/datastore/request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ describe('Request', function() {
542542

543543
describe('success', function() {
544544
var entityResults = ['a', 'b', 'c'];
545-
var endCursor = 'endCursor';
545+
var endCursor = new Buffer('abc');
546546

547547
var apiResponse = {
548548
batch: {
@@ -623,7 +623,7 @@ describe('Request', function() {
623623

624624
FakeQuery.prototype.start = function(endCursor_) {
625625
nextQuery = this;
626-
assert.strictEqual(endCursor_, endCursor);
626+
assert.strictEqual(endCursor_, endCursor.toString('base64'));
627627
startCalled = true;
628628
return this;
629629
};
@@ -677,7 +677,7 @@ describe('Request', function() {
677677
var offsetCalled = false;
678678

679679
FakeQuery.prototype.start = function(endCursor_) {
680-
assert.strictEqual(endCursor_, endCursor);
680+
assert.strictEqual(endCursor_, endCursor.toString('base64'));
681681
startCalled = true;
682682
return this;
683683
};

0 commit comments

Comments
 (0)