twilio / twilio-java

A Java library for communicating with the Twilio REST API and generating TwiML.
MIT License
477 stars 422 forks source link

Release 10 dropped support for range queries on the MessageReader #782

Closed zwalsh-toast closed 3 months ago

zwalsh-toast commented 4 months ago

Issue Summary

Release 10 appears to have dropped support for a feature of the API that exists in the documentation. The MessageReader class no longer has the methods setDateSentBefore or setDateSentAfter, in lieu of just setDateSent. This means that I can't query within a single day or across days with the SDK.

https://github.com/twilio/twilio-java/compare/9.0.0..10.0.0#diff-3fd79a945865becabb8b305f841be94f67fbac40df790e96b88e8fe300a25fe6L83-L90

Code Snippet

Before:

    public MessageReader setDateSentBefore(final ZonedDateTime dateSentBefore){
        this.dateSentBefore = dateSentBefore;
        return this;
    }
    public MessageReader setDateSentAfter(final ZonedDateTime dateSentAfter){
        this.dateSentAfter = dateSentAfter;
        return this;
    }

Now:

    public MessageReader setDateSent(final ZonedDateTime dateSent) {
        this.dateSent = dateSent;
        return this;
    }

This feature still exists in code snippets on the REST API documentation and the params still seem to be respected by the API, so I think this is a regression. Can this be fixed?

Technical details:

sbansla commented 4 months ago

@zwalsh-toast Range fields(dateSentBefore) are something internal. It was a bug in previous SDK versions. We will talk with internal team members to come up with conclusion on this. Either remove this from docs or add this to SDK.

zwalsh-toast commented 4 months ago

@sbansla Thanks! For my use case, this feature is really useful, so I hope it can be supported.

sbansla commented 3 months ago

@zwalsh-toast We have released 10.1.2 with the fix.

zwalsh-toast commented 3 months ago

@sbansla great, thank you!!