Successfully modified file: /home/Messier82/projects/service-book/app/src/main/java/com/servicebook/data/billing/BillingManagerImpl.kt (1 replacements). Here is the updated code: ... val hasPending = premiumPurchases.any { it.purchaseState == Purchase.PurchaseState.PENDING } // Always update the billing-derived state; StateFlow discards same-value writes. billingDerivedPremium.value = hasPurchased billingDerivedPending.value = hasPending // Guard the DataStore write using the in-memory cachedPremiumFlow so there is no extra // Flow suspension on the hot billing path. Only write when the persisted value actually // differs from the billing result (e.g., a premium user's cold-start re-confirmation // does not trigger a redundant DataStore edit). ...