urbanairship / python-library

A Python library for using the Airship APIs for push notifications, reporting and other message types
https://docs.airship.com/api/libraries/python/
Other
82 stars 65 forks source link

urbanairship.SegmentList not working #47

Closed louisguitton closed 4 years ago

louisguitton commented 4 years ago

All bugs, feature requests, implementation concerns or general queries should be sent to our support team.

You are welcome to submit an issue here for bugs, but please also reach out to our support team as well.

Before completing the form below, please check the following:

Expected Behavior

When listing the segments, I should get a response.

Current Behavior

The list is empty.

Possible Solution

Set next_url properly here https://github.com/urbanairship/python-library/blob/7ac8f59ffec4e01e6bf842af04bd65df6747c840/urbanairship/devices/segment.py#L118-L121

- next_url = airship.urls.get('segments_url')
+ self.next_url = airship.urls.get('segments_url')

Steps to Reproduce

import urbanairship as ua
airship = ua.Airship("app_key", "master_secret")
segment_list = ua.SegmentList(airship)

assert list(segment_list) == [] 
# True = bug

segment_list.next_url = airship.urls.get('segments_url')
assert list(segment_list) == []
# False = fix

Detailed Description

Possible Fix

Will see if I can open a PR

aschuman0 commented 4 years ago

Hi Louis. Thank you for the detailed bug report! I've created an internal issue tracking ticket for this and hope to have a release out with a fix in the next few days. Apologies for the issue. Please let me know if there is anything I can do in the meantime.

aschuman0 commented 4 years ago

Hi @louisguitton,

A fix for this issue was released in 5.3.1 which is available in this repo and on Pypi. Please let me know if there are any further issues. Thanks!

louisguitton commented 4 years ago

Well THAT was quick 🚀 amazing, thanks, I've downloaded 5.3.1 and tested it and it works as expected.

aschuman0 commented 4 years ago

Perfect! Glad we could turn that around so fast.