Skip to content

Move rescope token request to IO thread#7869

Merged
CDRussell merged 1 commit intodevelopfrom
feature/craig/duckchat-sync-rescope-on-io-thread
Mar 5, 2026
Merged

Move rescope token request to IO thread#7869
CDRussell merged 1 commit intodevelopfrom
feature/craig/duckchat-sync-rescope-on-io-thread

Conversation

@CDRussell
Copy link
Member

@CDRussell CDRussell commented Mar 4, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/608920331025315/task/1213530835574684?focus=true

Description

Moves the network request that happens in GetScopedSyncAuthTokenHandler to an io thread instead of trying to do it on the java bridge thread (which is for JS->Native comms).

Steps to test this PR

  • QA optional

Note

Medium Risk
Moves token rescoping into an injected app-level coroutine on the IO dispatcher, introducing async behavior that could affect response timing/cancellation and test determinism if dispatchers/scopes are misconfigured.

Overview
GetScopedSyncAuthTokenHandler now performs syncApi.rescopeToken asynchronously by launching on an injected @AppCoroutineScope with dispatcherProvider.io(), instead of executing inline on the message handler thread.

Tests are updated to inject a CoroutineTestRule test scope/dispatcher provider so the new coroutine-based behavior remains verifiable while keeping the existing success/error response and pixel assertions intact.

Written by Cursor Bugbot for commit 389af64. Configure here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Contributor

@joshliebe joshliebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙂

@CDRussell CDRussell merged commit 88367b6 into develop Mar 5, 2026
20 checks passed
@CDRussell CDRussell deleted the feature/craig/duckchat-sync-rescope-on-io-thread branch March 5, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants