-
Notifications
You must be signed in to change notification settings - Fork 582
Open
Labels
priority: mediumImportant but not urgent; Workaround availableImportant but not urgent; Workaround availabletype: bugbug in the librarybug in the library
Description
Issue Summary
Twilio php sdk functions:
content->v2->contentAndApprovals->stream()content->v2->contentAndApprovals->read()content->v2->contents->stream()content->v2->contents->read()
provides pageable interface to non pageable Twilio endpoints. Moreover doc above each function says pagination is supported and incorrectly explains how to use it.
In the same time Twilio doc says nothing about pagination support for these endpoints.
Attempt to use the functions with pagination (according to doc above them) leads to infinitive template downloading loop.
Steps to Reproduce. Scenario 1
- Create 51+ templates in your Twilio account
- Call
$twilioClient->content->v2->contentAndApprovals->read(); (no params, all default values) - See function in infinitive loop.
Steps to Reproduce. Scenario 2
- Create 11+ templates in your Twilio account
- Try to load them (max 100, page size 10).
$templates = $twilioClient->content->v2->contentAndApprovals->stream([], 100, 10); - Iterate
$templates. - See client ten times returns you first ten templates (it loads first 10, then asks 10 more, receives same 10 templates, ... )
Steps to Reproduce. Scenario 3
- Create 11+ templates in your Twilio account
- Try to load them (no limit, page size 10).
$twilioClient->content->v2->contentAndApprovals->stream([], null, 10); - See client returns you first ten templates in a loop that never ends.
Code Snippet
$twilioClient = new Client($sid, $token);
$templates = $twilioClient->content->v2->contentAndApprovals->stream([], null, 10);
foreach ($templates as $template) {
echo $template->sid;
}
// you need to have more than 10 templates to see infinitive loop with infinitive requests to Twilio APITechnical details:
- twilio-php version: 8.3.7
- php version: 8.2
Possible solution:
- Remove non supported arguments (
pageSize) from method signature. - Update invalid php doc
Metadata
Metadata
Assignees
Labels
priority: mediumImportant but not urgent; Workaround availableImportant but not urgent; Workaround availabletype: bugbug in the librarybug in the library