Skip to content

Conversation

jdavid
Copy link
Contributor

@jdavid jdavid commented Apr 4, 2018

  • RSH1a publish
  • RSH1b deviceRegistrations
    • RSH1b1 get
    • RSH1b2 list
    • RSH1b3 save
    • RSH1b4 remove
    • RSH1b5 removeWhere

@jdavid jdavid requested a review from funkyboy April 4, 2018 18:05
@coveralls
Copy link

coveralls commented Apr 4, 2018

Coverage Status

Coverage remained the same at ?% when pulling c0157c1 on push into ef4aa01 on master.

@funkyboy funkyboy requested a review from paddybyers April 5, 2018 06:50
@funkyboy
Copy link
Contributor

funkyboy commented Apr 5, 2018

@jdavid can you please take a look at the failing tests?

@jdavid
Copy link
Contributor Author

jdavid commented Apr 5, 2018

Yes I will look. Actually the failure also happens in the master branch, it's unrelated to the PR.

@funkyboy
Copy link
Contributor

funkyboy commented Apr 5, 2018

@jdavid Then it's probably better to solve it a separate PR, and then rebase this when the fix for tests has been merged.

Copy link
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.

Just a couple of comments.

def ably(self):
return self.__ably

def publish(self, recipient, data):
Copy link
Member

Choose a reason for hiding this comment

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

I'm comparing with the analogous RET publish method (https://github.com/ably/ably-python/blob/master/ably/rest/channel.py#L70)

There, we have inline doc strings - should we also do that here?


body = data.copy()
body.update({'recipient': recipient})
return self.ably.http.post('/push/publish', body=body)
Copy link
Member

Choose a reason for hiding this comment

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

Elsewhere there's a timeout argument in the http post - should we also have that here?

if protocol == 'json':
self.assertEquals(response.headers['content-type'], 'application/json')
json.loads(response.text)
if response.content:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a super expert in Python, but why not testing for response.text, which is what you access in the subsequent line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I copied if response.content: from the msgpack case, just a few lines below.

content is the response body as a byte string, text is the same as a text string (unicode)

I have done a different fix, and used response.json() instead of json.loads(...).

@jdavid jdavid changed the title RSH1a New push.admin.publish Push notifications Apr 12, 2018
@paddybyers
Copy link
Member

I would prefer please if each set of changes had its own PR, raised against this push branch. As each is reviewed it can be merged, but as things stand I think this single PR is going to get too crowded and the different threads of comments and changes will all get too complex. Also it means we can track the work more easily, because we can link each of those individual PRs in the tracking spreadsheet.

@funkyboy can you help to set that up please?

@jdavid
Copy link
Contributor Author

jdavid commented Apr 13, 2018

Okay, closing this PR. Will reset the push branch.

@jdavid jdavid closed this Apr 13, 2018
@jdavid
Copy link
Contributor Author

jdavid commented Apr 13, 2018

See #106

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.

4 participants