Fixing the Motus Paywall Edge Cases
Two iOS subscription bugs that stranded paying users at the paywall: a restore flow that returned nothing and StoreKit cancel detection that was too narrow.
I spent this week fixing two subscription bugs that were hitting real Motus users.
Motus Paywall Edge Cases
Two subtle iOS subscription bugs surfaced this week, both annoying enough that users noticed.
First: the "Restore Purchases" button was returning null even when RevenueCat showed an active entitlement. A user would tap restore, see nothing happen, then get stuck at the paywall despite having already paid. I added a fallback that checks RevenueCat's entitlement API directly when the restore comes back empty — if there's an active subscription there, we create a local subscription object and unlock the UI. Not elegant, but it works.
Second: StoreKit's cancel detection was too narrow. I was only checking err.code === 1 and err.userCancelled, but Apple's error handling isn't consistent across versions. Users who tapped "Cancel" on the purchase sheet were seeing "Purchase Failed" errors instead of the flow just closing. I broadened the check to also scan the error message string for "cancel" or "user cancelled" — now canceling works like it should.
Both fixes shipped in the same commit. 49 total code changes this week, most of them small staging and CI fixes to keep the build pipeline moving.
What's Next
Motus has a few social platform integrations (YouTube, Instagram, Threads) that are wired up but need end-to-end OAuth testing and permissions approval. I'll run those through next week. Also need to consolidate the brief generation flow — there are currently two separate entry points that trigger it, which is redundant and confusing.