feat: handle extension verification and retry-after on download

Classify verification-required and rate-limit errors from extensions, propagate Retry-After seconds through the download fallback, report session-grant success/failure, and add a completeGrant action fallback in the runtime.
This commit is contained in:
zarzet committed 2026-06-26 07:12:12 +07:00
1 parent d9f0007a2d
commit 9c054b9e3a
8 files changed
+353 -82

No files matched your search

@@ -2112,19 +2112,24 @@ class MainActivity: FlutterFragmentActivity() {
android.util.Log.i("SpotiFLAC", "Extension callback complete for $extId: $json")
if (isSessionGrant) {
withContext(Dispatchers.Main) {
notifySessionGrantCompleted(extId)
notifySessionGrantCompleted(extId, true)
}
}
} catch (e: Exception) {
android.util.Log.w("SpotiFLAC", "Extension callback failed: ${e.message}")
if (isSessionGrant) {
withContext(Dispatchers.Main) {
notifySessionGrantCompleted(extId, false)
}
}
}
}
}
private fun notifySessionGrantCompleted(extensionId: String) {
private fun notifySessionGrantCompleted(extensionId: String, success: Boolean) {
val payload = mapOf(
"extension_id" to extensionId,
"success" to true,
"success" to success,
)
val channel = backendChannel
if (channel == null) {