mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
Play reports a purchase as PENDING while a slow payment method (cash, carrier billing, bank transfer) is still being processed. Until now BillingConnection dropped those at ingestion, so the app had no idea the user had bought anything: the upgrade screen kept selling, and a second purchase attempt was rejected by Play with ITEM_ALREADY_OWNED. Pending purchases now enter the reducer state and travel to the UI, while every entitlement exit stays PURCHASED-only: - BillingConnection ingests PURCHASED + PENDING (UNSPECIFIED_STATE is still dropped everywhere). The freshUpdates stream keeps receiving only PURCHASED, and provesAbsence now ignores a surviving PENDING overlay entry, so a payment in progress can't freeze the unconfirmed-episode clock. - combinePurchaseResults gets the sku-type resolver: a PENDING result only suppresses the couldn't-verify error when it maps to a known Pro SKU. An unknown pending product proves nothing about the type whose query failed. - PurchaseRefresh now carries provenance (confirmed set, hasConfirmedProPurchase, commit-time occurredAt, partialError) instead of just the merged view plus isComplete. - BillingData splits into purchases (entitlement carrier) and pendingPurchases via a single from() classifier used at every exit. - BillingManager gains processReconciliation(), run after the connect loop's initial refresh and by refresh(): it re-signals dead-binder invalidation and feeds the grace episode clock with the refresh's COMMIT time. The ack pass skips pending purchases, which Play rejects permanently and would report as a bug every pass. - BillingConnection.querySubscriptions / BillingManager.querySubscriptions are replaced by refreshStrict(): the pre-purchase gate needs both product types and the pending state, and still fails closed on anything short of a complete round-trip. - UpgradeRepoGplay exposes Info.pendingSkus (never part of isPro), Info.hasAutoRenewingSubscription, verifyPurchaseStateNow() for the gates, and reports PendingPurchaseBillingException when an already-owned recovery finds a pending payment. The grace branch now carries billingData through so pending stays visible while Pro runs on grace.