Skip to content

Commit d53376a

Browse files
wyardleyJustinBeckwith
authored andcommitted
fix: Change to "greater than" for limit on number of elements (#386)
Fixes #149
1 parent c141b48 commit d53376a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/packages/google-gax/src/bundling.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,10 @@ export class BundleExecutor {
384384
const countLimit = this._options.elementCountLimit || 0;
385385
const byteLimit = this._options.requestByteLimit || 0;
386386

387-
if ((countLimit > 0 && elementCount >= countLimit) ||
387+
if ((countLimit > 0 && elementCount > countLimit) ||
388388
(byteLimit > 0 && requestBytes >= byteLimit)) {
389389
let message;
390-
if (countLimit > 0 && elementCount >= countLimit) {
390+
if (countLimit > 0 && elementCount > countLimit) {
391391
message = 'The number of elements ' + elementCount +
392392
' exceeds the limit ' + this._options.elementCountLimit;
393393
} else {

packages/packages/google-gax/test/bundling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ describe('Executor', () => {
704704
expect(Object.keys(executor._tasks).length).to.eq(0);
705705

706706
executor.schedule(
707-
spy, {field1: [1, 2, 3, 4, 5, 6, 7], field2: 'id'}, err => {
707+
spy, {field1: [1, 2, 3, 4, 5, 6, 7, 8], field2: 'id'}, err => {
708708
expect(err).to.be.an.instanceOf(Error);
709709
done();
710710
});

0 commit comments

Comments
 (0)