Skip to content

Support apns http2 node apn version#134

Closed
superkhau wants to merge 1 commit into
masterfrom
support-apns-http2-node-apn-version
Closed

Support apns http2 node apn version#134
superkhau wants to merge 1 commit into
masterfrom
support-apns-http2-node-apn-version

Conversation

@superkhau

@superkhau superkhau commented Nov 9, 2016

Copy link
Copy Markdown
Contributor

Helping land #133

cc @iliraga @raymondfeng

@superkhau superkhau force-pushed the support-apns-http2-node-apn-version branch from 467c68b to d668f92 Compare November 9, 2016 09:32
@superkhau

Copy link
Copy Markdown
Contributor Author

@raymondfeng The tests are failing because the new node-apns uses es6 enhanced object literal syntax: https://github.com/node-apn/node-apn/blob/master/index.js#L28. Merging this will mean we're not supporting node 10/12 anymore. Will ping you in the morning to confirm how to move forward.

@raymondfeng

Copy link
Copy Markdown
Member

Hmm, that's annoying. I guess we can potentially release a new major version that requires Node 4 or later.

@superkhau

Copy link
Copy Markdown
Contributor Author

I agree with your proposed solution because I don't see simpler way around this without forking and maintaining 2 versions. We're dropping 10 soon anyways and 12 in like another month or so: strongloop/loopback#2807. The question is whether you want to just land this now or wait for LB to officially drop support.

@bajtos Thoughts?

@bajtos

bajtos commented Nov 11, 2016

Copy link
Copy Markdown
Member

We should start a new major version of loopback-component-push first and drop support for Node v0.10/v0.12 there. This pull request should be landed on the new master and should not affect current version line 1.x.

Dropping support for Node v0.10/v0.12 is basically waiting for our CI build-framework to recognize engines.node field and don't run tests on older versions of Node (internal reference: https://github.com/strongloop-internal/build-framework/pull/12).

@bajtos

bajtos commented Nov 14, 2016

Copy link
Copy Markdown
Member

Now that #135 was landed, we can move forward with this patch too. @superkhau


it('sends Notification as an APN message', function(done) {
givenProviderWithConfig();
givenProviderWithConfig(defaultConfiguration);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of givenProviderWithConfig is to create a provider with sensible default configuration, so that we don't have to repeat ourselves in the tests and also don't have to change all tests when the default configuration changes like here.

Please change givenProviderWithConfig to set sensible apns defaults and revert changes in this file.

done();
// HACK: Timeout does not work at this point
Promise.resolve(true).then(function() {
assert(eventSpy.called);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You lost the assertion on notifications reported:

expect(eventSpy.args[0]).to.deep.equal([devices]);

interval: 300,
},
// Sign up an application
Application.register('test-user', 'TestApp', {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unrelated whitespace change to me, can we please revert?

pushNotification: function(notification, deviceToken) {
// console.log(notification, deviceToken);
assert.equal(deviceToken, result.deviceToken);
assert.equal(deviceToken, deviceToken);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asserting that X == X makes no sense as it always passes. Please revert this line.

@superkhau

superkhau commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

@iliraga Would you like to address the comments above by @bajtos in your PR at #133? You can push your updates there and I can help you reland it again when you ping again.

@iliraga

iliraga commented Nov 16, 2016

Copy link
Copy Markdown
Contributor

@superkhau I will address those issues and deliver a solution within this week if possible.

@superkhau

Copy link
Copy Markdown
Contributor Author

@iliraga No problem, just ping again when you need review/help landing after your updates. Let's continue the conversation in your other PR. I'm going to close this and try to land your original PR since you'll be pushing updates anyways. Please rebase it with master while you're at it.

@superkhau superkhau closed this Nov 16, 2016
@superkhau superkhau removed the #review label Nov 16, 2016
@superkhau superkhau deleted the support-apns-http2-node-apn-version branch November 16, 2016 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants