You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 = newClient($sid, $token);
$templates = $twilioClient->content->v2->contentAndApprovals->stream([], null, 10);
foreach ($templatesas$template) {
echo$template->sid;
}
// you need to have more than 10 templates to see infinitive loop with infinitive requests to Twilio API
Technical 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
The text was updated successfully, but these errors were encountered:
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
$twilioClient->content->v2->contentAndApprovals->read()
; (no params, all default values)Steps to Reproduce. Scenario 2
$templates = $twilioClient->content->v2->contentAndApprovals->stream([], 100, 10);
$templates
.Steps to Reproduce. Scenario 3
$twilioClient->content->v2->contentAndApprovals->stream([], null, 10);
Code Snippet
Technical details:
Possible solution:
pageSize
) from method signature.The text was updated successfully, but these errors were encountered: