nylas-java icon indicating copy to clipboard operation
nylas-java copied to clipboard

Slashes in the id are not escaped when requesting a thread

Open flokle opened this issue 1 year ago • 2 comments

Describe the bug If a thread id contains a “/”, it is not escaped when querying a single thread and a "Unrecognized request URL" error is returned.

To Reproduce Query a single thread via the SDK where the id contains a “/”

Expected behavior The id is fully escaped on request, the thread data is returned

SDK Version: 2.5.0

flokle avatar Dec 26 '24 10:12 flokle

If i can add something else, the same problem occur when trying to fetch for a folder with id containing "/", seems like the the ids are simply encoded but the "/" are not replaced by most basics encoding function, they need to be replace manually account.getId().replaceAll("/", "%2F") worked for me as a temporally solution but could be a really good add to the sdk

alanschnegg avatar Dec 31 '24 09:12 alanschnegg

I‘ve also tried to replace the slashes before, but the ‚%‘ is replaced by the escaping mechanism of the sdk afterwards. Which leads to ‚%252F‘.

A workaround for me was to wrap these ids by some strings like ‚blabla(ID)blabla and add an Interceptor to the underlying okhttp requester. This interceptor unwraps the id, adjusts the HttpUrl accordingly - and replaces the slashes within the id.

flokle avatar Dec 31 '24 11:12 flokle