Testing Recovery Workflows
Recovery testing validates that SolydFlow automatically rescues transactions when real-world failures occur—such as a customer completing payment and then losing mobile connectivity, closing the browser, or having a webhook blocked.
[1. Complete Test Payment] ➔ [2. Kill App / Drop Socket] ➔ [3. Sweeper Reconciles in Background] ➔ [4. Entitlement Restored]
Test 1: The "Force-Close" Test (Mobile App)
This test proves that customers who pay via USSD, Bank Transfer, or M-Pesa but lose cellular data still get their pro access restored automatically.
Test Steps:
- Launch your mobile app in debug/test mode (
sf_pk_test_...). - Trigger the paywall and select a package (e.g.
pro_monthly_ngn). - Complete the payment authorization using a test card or simulator PIN.
- Immediately force-close / swipe away the app before the success screen appears.
- Wait 15 to 30 seconds for the gateway settlement to register.
- Re-open your mobile app.
- Verify that access was restored automatically without prompting the user to pay again:
- Flutter
- JavaScript / TypeScript (Web)
lib/screens/dashboard.dart
// On app launch, hasEntitlement reads from encrypted local storage
// and checks if the Sweeper settled the orphaned transaction.
final bool isPro = await SolydFlow.hasEntitlement("pro_access");
print("Restored Access: $isPro"); // Expected: true ✅
src/access.ts
const isPro = await SolydFlow.hasEntitlement("pro_access");
console.log("Restored Access:", isPro); // Expected: true ✅
Test 2: The "Blocked Webhook" Test (Backend / Web)
This test proves that SolydFlow's Consensus Engine does not depend solely on webhooks to unlock subscriptions.
Test Steps:
- In the SolydFlow Console, go to Inbound Gateway Webhooks.
- Temporarily enter an invalid webhook URL (e.g.
https://httpstat.us/500) to simulate a complete webhook delivery outage. - Open the Solyd Simulator in
Test (Sandbox)mode. - Select a package and complete checkout using a test card.
- In your gateway dashboard, the webhook will show as failed (
500 Internal Error). - Watch the SolydFlow Simulator Log:
- After 45 seconds of webhook silence, the Sweeper detects the
UNRESOLVED_ORPHANtransaction. - The Sweeper queries the gateway's REST API directly using your Vault secret key.
- The transaction settles to
SETTLED_CONSENSUS. - Entitlement
pro_accessunlocks cleanly.
- After 45 seconds of webhook silence, the Sweeper detects the
- Re-enable your valid webhook URL once the test is complete.
What the Ledger Looks Like During Recovery
When a recovery test succeeds, inspect the transaction in SolydFlow Console → Transactions Ledger. You will see the complete audit trail:
┌───────────────────────────────────────┬────────────────────────────────────────────────────────┐
│ Timestamp │ State Transition & Operational Source │
├───────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ **10:00:00** │ `INITIALIZED` (Client started checkout) │
├───────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ **10:00:45** │ `UNRESOLVED_ORPHAN` (Callback missing after 45s) │
├───────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ **10:01:00** │ `RECOVERING` (Sweeper queried gateway verify API) │
├───────────────────────────────────────┼────────────────────────────────────────────────────────┤
│ **10:01:02** │ `SETTLED_CONSENSUS` (Entitlement "pro_access" granted) │
└───────────────────────────────────────┴────────────────────────────────────────────────────────┘
What a Successful Recovery Test Proves
Passing these tests confirms that:
- ✅ Network drops never lead to lost customer revenue.
- ✅ Dropped or blocked webhooks are recovered automatically via direct REST verification.
- ✅ Subscribers never have to contact support or pay twice for the same subscription.