Jericho / ZoomNet

.NET client library for the Zoom.us REST API v2
MIT License
69 stars 45 forks source link

Invalid conditional used when checking if there are total records when retrieving call logs #307

Closed joshrogers-pg closed 12 months ago

joshrogers-pg commented 12 months ago

When retrieving call logs against a user who has zero records an exception is thrown: Exception: The response does not contain a field called 'call_logs' (Parameter 'propertyName')

This appears to be because there is a bug in the retrieval logic that is looking at page size rather than total records to determine whether to throw the exception or not.

https://github.com/Jericho/ZoomNet/blob/3c3f0d40dc4372c861079eb72d3eeaeafc4a430b/Source/ZoomNet/Extensions/Internal.cs#L958-L989

Line #974 is checking for page size but the comments suggest it should be total records and looking at the payload that is if failing on, it appears checking for total_records > 0 would be the correct conditional.

{
  "next_page_token": "",
  "page_size": 100,
  "total_records": 0,
  "from": "2023-07-05",
  "to": "2023-07-12"
}
Jericho commented 12 months ago

You're right. Thanks for reporting this issue.

I'll write unit tests to highlight the faulty behavior you discovered and it will also allow us to validate that your PR solves this problem.

Jericho commented 12 months ago

:tada: This issue has been resolved in version 0.65.0 :tada:

The release is available on:

Your GitReleaseManager bot :package::rocket: