Automattic / Automattic/pocket-casts-android

Do not use coroutine APIs in the access token interceptor

Open
#2,733 0 comments 0 reactions 0 assignees View on GitHub
[Area] Network [Type] Tech Debt
Dominant language
Kotlin
Stars
2.8k
Forks
308
Avg merge
1d 13h
Merged PRs (30d)
143

Description

We have this piece of code:

https://github.com/Automattic/pocket-casts-android/blob/f354e0b0eedfcc60d02713a586e6bf432449b466/modules/services/servers/src/main/java/au/com/shiftyjelly/pocketcasts/servers/di/ServersModule.kt#L248-L273

Using `runBlocking` can lead to problems. While we don't have any issues at the moment it is a potential footgun. See: https://github.com/square/okhttp/issues/7164

Contributor guide

Open the contributing guide

Research direction

Start with the access-token interceptor in modules/services/servers/src/main/java/au/com/shiftyjelly/pocketcasts/servers/di/ServersModule.kt, lines 248-273, and review the linked OkHttp discussion about runBlocking. Determine an approach that avoids coroutine APIs in the interceptor, then verify that access-token handling still works without blocking coroutine usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
authentication, mobile, networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.