Skip to content

RSH1a New push.admin.publish#59

Merged
jdavid merged 6 commits intopushfrom
RSH1a
Feb 6, 2019
Merged

RSH1a New push.admin.publish#59
jdavid merged 6 commits intopushfrom
RSH1a

Conversation

@jdavid
Copy link
Copy Markdown
Contributor

@jdavid jdavid commented Oct 21, 2018

RSH1a New push.admin.publish

Otherwise the last assert in the test is not done.
@jdavid
Copy link
Copy Markdown
Contributor Author

jdavid commented Oct 25, 2018

ping

Copy link
Copy Markdown
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

I think it would be best to create a new integration branch for the push functionality, and raise pull requests against that. That means we can merge individual PRs to that branch, and can merge finally to master once there is a coherent set of functionality implemented.

* RSH1a
*/
public function testAdminPublish() {
$recipient = [ 'clientId' => 'ablyChannel' ];
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.

Does this work? It's supposed to be a push recipient with a transportType field of type DevicePushTransportType. In order to cause a push message to be sent to an Ably channel for testing, then the transportType must be ablyChannel. Then the other recipient details must include channel, ablyKey and ablyUrl. See for example https://github.com/ably/ably-ios/blob/develop/Spec/PushAdmin.swift#L232

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The server is not rejecting the message.

This is also like in the curl example at https://docs.ably.io/rest-api/#push-publish where only the clientId is given:

...
  "recipient": {
    "clientId": "myClientId"
  },
...

And the documentation at https://docs.ably.io/client-lib-development-guide/features/#RSH1a doesn't say anything about transportType etc., just:

... using the special test-only ablyChannel recipient ...

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 recipient needs to look like:

		transportType: 'ablyChannel',
		channel: <channel on which to publish the message>,
		ablyKey: <Ably API key string>,
		ablyUrl: <Ably endpoint URL>

In that case, when you post the message to be published, it will be delivered to an Ably channel and you'll be able to retrieve it using history.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done but history doesn't work, test failure.

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.

@jdavid what type of failure? Do you have a log? Are you using a channel with history enabled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The failure is Failed asserting that 0 matches expected 1. ; the test pushes to pushenabled:push_admin_publish-ok see https://github.com/ably/ably-php/blob/RSH1a/tests/PushAdminTest.php#L29

Then gets the channel history. I expect to be 1 item in the history, but there're zero items.

I tried locally adding "persisted": true to the namespace but got the same failure.

I've added debugging, search for testAdminPublish in https://api.travis-ci.org/v3/job/455908053/log.txt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ping

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.

@jdavid have reminded @paddybyers to look at this...

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.

@jdavid I've had a look at the code and I can't see why it wouldn't work. I'm assuming that the value of $testApp->server is a URL, ie https://sandbox-rest.ably.io.

The channel in use is a pushenabled channel whereas it doesn't need to be push-enabled for this test to work. Strictly, since you're getting history on the channel you should use a persisted:xx channel for the test, but I'm sure you're getting history immediately after the call so any channel should work.

So I suggest that either (1) you help me with getting a local setup to help me reproduce it, or (2) you try at a time that I can look at the logs and see what's going on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, I've just re-run the tests and now it's all green.. Maybe something changed in the server in these 2.5 months?

Can we say it's good for merging now? Approved?

@jdavid jdavid changed the base branch from master to push October 30, 2018 18:15
@jdavid
Copy link
Copy Markdown
Contributor Author

jdavid commented Oct 30, 2018

Created a new branch named push, and updated the base of this PR.

Copy link
Copy Markdown
Member

@paddybyers paddybyers left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@jdavid jdavid merged commit b43571e into push Feb 6, 2019
@jdavid jdavid deleted the RSH1a branch February 6, 2019 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants