Skip to content

fix(threads): URL-encode thread id in path#318

Merged
googsvg merged 2 commits intonylas:mainfrom
SAY-5:fix/issue-260-encode-thread-id-path
May 6, 2026
Merged

fix(threads): URL-encode thread id in path#318
googsvg merged 2 commits intonylas:mainfrom
SAY-5:fix/issue-260-encode-thread-id-path

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 5, 2026

Fixes #260. Thread ids containing / were passed unencoded into the request path, where OkHttp's addPathSegments splits on / and produces a malformed URL. Encode the id with URLEncoder (replacing + with %20 so it stays a valid path segment) in find, update, and destroy.

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

Signed-off-by: SAY-5 <saiasish.cnp@gmail.com>
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.44%. Comparing base (443252f) to head (247f777).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/main/kotlin/com/nylas/resources/Notetakers.kt 0.00% 0 Missing and 5 partials ⚠️
src/main/kotlin/com/nylas/util/PathEncoder.kt 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #318      +/-   ##
============================================
- Coverage     82.47%   82.44%   -0.03%     
- Complexity      357      358       +1     
============================================
  Files            37       38       +1     
  Lines          1027     1031       +4     
  Branches         95       95              
============================================
+ Hits            847      850       +3     
- Misses          121      122       +1     
  Partials         59       59              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 6, 2026

The docs job failure is a pre-existing workflow-config issue, not a regression from this PR. The failing step is cloudflare/pages-action@v1 which errors with Input required and not supplied: apiToken because the CLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID repository secrets are not exposed to PRs from forks (a standard GitHub Actions security boundary). The Dokka build itself completes successfully (BUILD SUCCESSFUL in 29s); only the deploy-to-Cloudflare-Pages step fails, and that is the same on every fork PR.

The Lint, Build, Test, and Upload Coverage job which exercises the actual code change passes.

@googsvg
Copy link
Copy Markdown
Contributor

googsvg commented May 6, 2026

@SAY-5 first of all: thank you for contributing to this repo ❤️

I've just expanded your solution to all of our resources in this SDK, to have uniform solution across the repository

for sdk-reference, don't worry about it - it fails because for security reasons token cannot be passed to a fork. it is completely acceptable that this fails, and I do verify every PR :)

thanks again!
soon I'll deploy new sdk version

@googsvg googsvg merged commit fd75345 into nylas:main May 6, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slashes in the id are not escaped when requesting a thread

3 participants