Skip to content

Commit

Permalink
fix(publisher): unbound max send message size (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmehiphop authored and JustinBeckwith committed Jan 29, 2019
1 parent 462eecc commit 773a05c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ export class PubSub {
this.options = Object.assign(
{
'grpc.keepalive_time_ms': 300000,
'grpc.max_send_message_length': -1,
'grpc.max_receive_message_length': 20000001,
libName: 'gccl',
libVersion: PKG.version,
Expand Down
36 changes: 14 additions & 22 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ describe('PubSub', () => {
});

describe('instantiation', () => {
const DEFAULT_OPTIONS = {
'grpc.keepalive_time_ms': 300000,
'grpc.max_send_message_length': -1,
'grpc.max_receive_message_length': 20000001,
libName: 'gccl',
libVersion: PKG.version,
scopes: [],
};

it('should extend the correct methods', () => {
assert(extended); // See `fakePaginator.extend`
});
Expand Down Expand Up @@ -236,19 +245,10 @@ describe('PubSub', () => {
a: 'b',
c: 'd',
};
const expectedOptions = Object.assign({}, DEFAULT_OPTIONS, options);

googleAuthOverride = options_ => {
assert.deepStrictEqual(
options_,
Object.assign(
{
'grpc.max_receive_message_length': 20000001,
'grpc.keepalive_time_ms': 300000,
libName: 'gccl',
libVersion: PKG.version,
scopes: [],
},
options));
assert.deepStrictEqual(options_, expectedOptions);
return fakeGoogleAuthInstance;
};

Expand All @@ -257,17 +257,9 @@ describe('PubSub', () => {
});

it('should localize the options provided', () => {
assert.deepStrictEqual(
pubsub.options,
Object.assign(
{
'grpc.max_receive_message_length': 20000001,
'grpc.keepalive_time_ms': 300000,
libName: 'gccl',
libVersion: PKG.version,
scopes: [],
},
OPTIONS));
const expectedOptions = Object.assign({}, DEFAULT_OPTIONS, OPTIONS);

assert.deepStrictEqual(pubsub.options, expectedOptions);
});

it('should set the projectId', () => {
Expand Down

0 comments on commit 773a05c

Please sign in to comment.