Closed Bladieblah closed 10 months ago
Hi @Bladieblah, thanks for your PR. Due to holidays, we were unable to give you a response any sooner than today. We'll look into your work later this week.
@Bladieblah Your idea has an interesting, different take on the problem than we already tried in #323.
You state that your PR solves the issue with minimal changes. The actual problem with the pagination is that none of it is under test, which is why we never discovered and solved the issue in the first place. Your PR unfortunately doesn't fix that, and we have a different PR in draft that also tries to solve this issue in a different way, with some tests added (but not completed yet).
I took your branch and added a few tests on Subscriptions (the original issue) and CustomerSubscriptions (a nested variant of the same endpoint), they pass so your code seems to be okay :+1:
Note: your PR mentions removal of get_resource_class
in several places, but in fact you removed get_resource_object
. The get_resource_class
method has its own problems, but you're not fixing them here (which is fine).
Hi @whyscream, thanks for looking at the PR!
I messed up somewhere because I definitely intended to remove get_resource_class
everywhere, I made the changes first in another repo for an API client that I based off of this one. I now made the remaining changes so get_resource_class
is completely gone. I also added the tests you made for the pagination endpoint and they do indeed pass.
Apologies for the confusion!
I added all tests I wrote for Subscriptions, and also some new tests for all places where you can list Chargebacks. I think we covered not all, but at least some of the places where pagination happens, so that we can verify that it works now.
I have refactored the
ObjectList
class in order to solve #315 with minimal changes. I completely removed theget_resource_class
method from all theResource
s, which now instead just store the type of the underlying object. TheObjectList
class was being used for (as far as I'm concerned) 2 purposes:list
endpointsThis distinction in function is now explicit with the
PaginationList
andObjectList
classes. Another benefit of this approach, is that paginating an endpoint no longer creates duplicateResource
objects.Let me know what you think!