Skip to content
Launch GitLab Knowledge Graph

🚨 HOTFIX: Fix iOS crash on iPhone 14 Pro with offline mode (8.2% crash rate)

Emergency Hotfix - iOS Crash

This hotfix resolves critical crashes affecting iPhone 14 Pro users when enabling offline mode.

Impact

Current State:

  • 📱 Affected devices: iPhone 14 Pro, iPhone 14 Pro Max
  • 👥 Affected users: 24,000 users (8.2% of iOS user base)
  • App Store rating: Dropped from 4.6 → 4.1
  • 📉 Daily active users: Down 12% in last 3 days
  • 💰 Revenue impact: ~$18,000/day in lost subscription renewals

Root Cause:

// ❌ BEFORE: Synchronous 85MB AsyncStorage write caused memory spike
await AsyncStorage.setItem("offline_data", JSON.stringify(userData));
// Result: iPhone 14 Pro terminated app (memory limit: 1.5GB)

Solution

1. Chunked AsyncStorage Writes

// ✅ AFTER: Write data in 10MB chunks
for (let i = 0; i < chunks; i++) {
  const chunk = data.slice(start, end);
  await AsyncStorage.setItem(`${key}_chunk_${i}`, chunk);
  await new Promise(resolve => setTimeout(resolve, 100)); // Release event loop
}

2. Mutex Locking

// ✅ Prevent race conditions with concurrent writes
await storageMutex.runExclusive(async () => {
  // Atomic write operation
});

3. Memory Monitoring

// ✅ Track memory usage during writes
if (memoryUsage > MEMORY_THRESHOLD) {
  logger.warn("High memory usage detected");
  await releaseMemory();
}

Testing

Manual Testing (iPhone 14 Pro, iOS 17.4):

  • Enable offline mode with 85MB data: No crash
  • Enable offline mode 10 times consecutively: No crash
  • Background mode switch during sync: No crash
  • Low memory simulation (Instruments): No crash

Automated Testing:

# Detox E2E test
test: offline_mode_iphone14_pro
  ✅ enable_offline_mode: PASS
  ✅ sync_large_dataset: PASS (85MB)
  ✅ background_foreground_switch: PASS
  ✅ memory_pressure_scenario: PASS

Expected Results:

  • Crash rate: 8.2% → <0.1%
  • App Store rating recovery: 4.1 → 4.5+ within 2 weeks
  • User retention: +12% DAU recovery

Deployment Plan

  1. Emergency TestFlight (Today, 3pm UTC)

    • Distribute to 500 beta testers
    • Monitor crash analytics for 2 hours
  2. Phased Rollout (Tomorrow)

    • 10% rollout: 2 hours monitoring
    • 50% rollout: 4 hours monitoring
    • 100% rollout: If crash rate <0.1%
  3. App Store Submission (Tomorrow, 6pm UTC)

    • Expedited review requested
    • Release notes highlighting crash fix

Closes #12 (closed)

⚠️ URGENT: This affects 24K users and $18K/day revenue. Requesting expedited review from @sabrina.

cc: @dmitry - FYI: This also improves offline sync for React Native recommendations widget

Merge request reports

Loading