Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging breaks when filtering with To number with + sign #569

Closed
chadselph opened this issue Aug 20, 2020 · 2 comments · Fixed by #571
Closed

Paging breaks when filtering with To number with + sign #569

chadselph opened this issue Aug 20, 2020 · 2 comments · Fixed by #571
Labels
type: bug bug in the library

Comments

@chadselph
Copy link

Issue Summary

When filtering a list of calls or messages by the to/from number, when including the leading + (E.164 format) the auto-paging breaks.

Steps to Reproduce

  1. Get a number with more than 5 calls
  2. Plug it into my example code.

Code Snippet

import com.google.common.collect.Iterators;
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.Call;

public class ReproduceTwilioBug {

    static {
        Twilio.init("xxx", "yyy");
    }

    public static void main(final String args[]) {
        final String to = "+1843xxxx";
        countCalls(to);
        countCalls(to.replace("+", ""));
    }

    static void countCalls(final String to) {
        ResourceSet<Call> calls = Call.reader().setTo(to).pageSize(5).limit(20).read();
        System.out.println("For " + to + " " + Iterators.size(calls.iterator()) + " calls.");
    }
}

This outputs

For +1843xxxx 5 calls.
For 1843xxxx 20 calls.

It's able to download the first page, but when it gets to page 2 (Page=1&PageToken=PG...) I get back calls: [] in the JSON. When I step through with the debugger the URL looks correct, and querying that URL with different HTTP clients (Insomnia, curl) returns the call records. I suspect the + is getting encoded into %2B too early and then getting encoded again.

Technical details:

  • twilio-java version: 7.55.0
  • java version: Adopt JDK 1.11.0-6
@childish-sambino childish-sambino added status: help wanted requesting help from the community type: bug bug in the library labels Aug 24, 2020
@childish-sambino
Copy link
Contributor

Relates to #558

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.

@childish-sambino
Copy link
Contributor

May be related: #570

@childish-sambino childish-sambino added status: work in progress Twilio or the community is in the process of implementing and removed status: help wanted requesting help from the community labels Aug 26, 2020
@childish-sambino childish-sambino removed the status: work in progress Twilio or the community is in the process of implementing label Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug bug in the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants