You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Offload storage clearing to background thread to prevent ANR
Refactored `clearInternalStorage` in `SyncActivity` to be a `suspend` function, moving the file deletion logic to a background thread using `withContext(Dispatchers.IO)`.
This prevents the main thread from being blocked during the potentially long-running storage cleanup process, resolving a critical ANR risk.
Additionally, the `StrictMode` policy was strengthened to include `penaltyDeath()` in debug builds. This will proactively catch similar main-thread I/O regressions in the future by causing the app to crash during development, making such issues impossible to ignore. A race condition was also fixed by ensuring the sync process only starts after the storage clearing is complete.
0 commit comments