diff --git a/compose/shared/src/commonMain/kotlin/build/raft/app/thread/ThreadPage.kt b/compose/shared/src/commonMain/kotlin/build/raft/app/thread/ThreadPage.kt index 985ca97bd1..8e36e67240 100644 --- a/compose/shared/src/commonMain/kotlin/build/raft/app/thread/ThreadPage.kt +++ b/compose/shared/src/commonMain/kotlin/build/raft/app/thread/ThreadPage.kt @@ -3315,7 +3315,15 @@ private fun SharedThreadRouteContentContent( // composer that opens this draft again picks up their progress or result. Keyed on this page's // own account and server (the shell scope's server, else the page's captured provenance), never // on whichever server the session selects later. - val attachmentUploadAccountId = currentSession?.user?.id?.trim()?.takeIf(String::isNotBlank) + // The account comes from the signed-in route owner at once, not only from the session this + // page loads asynchronously: a cached conversation renders its full page on the first frame + // (#5104), and an upload started from that frame (or by a handler it registered) must land in + // the same store the composer watches. Before, the first frame keyed the store on account "" + // and the tile stayed on "Checking file…" (Android 1.27.0, artin; reproduced by Reef). + val attachmentUploadAccountId = + (currentSession?.user?.id ?: sharedStores.currentAuthenticatedRouteOwner(storeScope)?.accountId) + ?.trim() + ?.takeIf(String::isNotBlank) val attachmentUploadServerId = threadComposerUploadOwnerServerId( shellServerId = storeScope.initialServerId,