Skip to content

Commit 1f45eeb

Browse files
committed
Fold provisioning + detection into one single-flight SiteProvisioningSource
Promotes the EditorCapabilityDetector into SiteProvisioningSource: one per-site, single-flight pipeline that ensures application-password credentials, recovers the REST root, and detects editor capabilities — each stage awaited before the next. Because the capability probe is now structurally downstream of credential provisioning, it can never run before the mint, so the first-login race is gone by construction rather than mitigated. The application-password card, connectivity banner, and editor preloader all render slices of the one SiteReadiness state. The mint/validate mechanics move out of ApplicationPasswordViewModelSlice (now a renderer) into the source's ensureAuth stage; the per-site single-flight subsumes the card's old 409-safety guard. The duplicate wpApiRestUrl heal collapses into the source's recoverRestUrl stage.
1 parent 50b2b88 commit 1f45eeb

11 files changed

Lines changed: 695 additions & 918 deletions

File tree

WordPress/src/main/java/org/wordpress/android/AppInitializer.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import org.wordpress.android.networking.ConnectionChangeReceiver
7171
import org.wordpress.android.networking.OAuthAuthenticator
7272
import org.wordpress.android.networking.RestClientUtils
7373
import org.wordpress.android.push.GCMRegistrationScheduler
74-
import org.wordpress.android.repositories.EditorCapabilityDetector
74+
import org.wordpress.android.repositories.SiteProvisioningSource
7575
import org.wordpress.android.support.ZendeskHelper
7676
import org.wordpress.android.ui.ActivityId
7777
import org.wordpress.android.ui.debug.cookies.DebugCookieManager
@@ -231,7 +231,7 @@ class AppInitializer @Inject constructor(
231231
lateinit var wpApiClientProvider: WpApiClientProvider
232232

233233
@Inject
234-
lateinit var editorCapabilityDetector: EditorCapabilityDetector
234+
lateinit var siteProvisioningSource: SiteProvisioningSource
235235

236236
@Inject
237237
lateinit var openWebLinksWithJetpackHelper: DeepLinkOpenWebLinksWithJetpackHelper
@@ -722,8 +722,8 @@ class AppInitializer @Inject constructor(
722722
wpServiceProvider.clearAll()
723723
wpApiClientProvider.clearAllClients()
724724

725-
// Drop per-site editor-capability detection state for the signed-out user
726-
editorCapabilityDetector.clear()
725+
// Drop per-site provisioning + capability state for the signed-out user
726+
siteProvisioningSource.clear()
727727
}
728728

729729
/*

WordPress/src/main/java/org/wordpress/android/repositories/EditorCapabilityDetector.kt

Lines changed: 0 additions & 158 deletions
This file was deleted.

0 commit comments

Comments
 (0)