Description:
Currently, heavy file manipulation tasks—such as decoding Base64 strings, copying URIs to temporary files, and writing to the cache directory—are executing on the Main/UI thread in several repository modules. This blocks the main thread, causing the UI to freeze and significantly increasing the risk of Application Not Responding (ANR) crashes, particularly on lower-end devices used by field workers.
Affected Files (in FLW-Mobile-App):
SaasBahuSammelanRepo.kt
VLFRepo.kt
UwinRepo.kt
MaaMeetingRepo.kt
Expected Behavior:
All disk read/write operations, decoding, and file compressions should be offloaded to a background coroutine dispatcher to ensure the UI remains responsive during data saves.
Suggested Fix:
Wrap the synchronous file manipulation and I/O blocks inside a coroutine scope using withContext(Dispatchers.IO) { ... }.
Description:
Currently, heavy file manipulation tasks—such as decoding Base64 strings, copying URIs to temporary files, and writing to the cache directory—are executing on the Main/UI thread in several repository modules. This blocks the main thread, causing the UI to freeze and significantly increasing the risk of Application Not Responding (ANR) crashes, particularly on lower-end devices used by field workers.
Affected Files (in
FLW-Mobile-App):SaasBahuSammelanRepo.ktVLFRepo.ktUwinRepo.ktMaaMeetingRepo.ktExpected Behavior:
All disk read/write operations, decoding, and file compressions should be offloaded to a background coroutine dispatcher to ensure the UI remains responsive during data saves.
Suggested Fix:
Wrap the synchronous file manipulation and I/O blocks inside a coroutine scope using
withContext(Dispatchers.IO) { ... }.