twilio-csharp
twilio-csharp copied to clipboard
Can Not Enumerate Twice Over a ResourceSet That Has Pages
Issue Summary
Once you enumerate over a ResourceSet<T>
that has pages, on subsequent enumerations you only get back the last page
Code Snippet
var messageResource = await MessageResource.ReadAsync(readMessageOptions, client).ConfigureAwait(false);
Console.WriteLine($"Found {messageResource.Count()} Messages");
Console.WriteLine($"Found {messageResource.Count()} Messages");
Outputs
Found 236 Messages
Found 36 Messages
Problem code is in ResourceSet.cs where FetchNextPage()
overrides the prior page's _iterator
and doesn't keep track of it.
This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.