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
{{ message }}
This repository was archived by the owner on Aug 26, 2026. It is now read-only.
In data/analysis/impl/src/main/java/com/metasearch/android/data/analysis/impl/repository/AnalysisRepositoryImpl.kt, the finally block inside uploadImages has fileRepository.deleteFile(tempFile) commented out as a temporary workaround to prevent a race condition where OkHttp had not fully flushed data to the server before the temp file was deleted (causing 'Corrupt JPEG' errors).
While this prevents the corruption issue, it causes temp files to accumulate in cacheDir over time, leading to unnecessary disk usage.
Steps to Reproduce
Trigger image uploads via uploadImages() in AnalysisRepositoryImpl
Observe that temp files in cacheDir are never cleaned up
Proposed Solutions
One of the following approaches should be implemented:
Deferred coroutine deletion – After the upload completes, schedule cleanup with a short delay:
Summary
In
data/analysis/impl/src/main/java/com/metasearch/android/data/analysis/impl/repository/AnalysisRepositoryImpl.kt, thefinallyblock insideuploadImageshasfileRepository.deleteFile(tempFile)commented out as a temporary workaround to prevent a race condition where OkHttp had not fully flushed data to the server before the temp file was deleted (causing 'Corrupt JPEG' errors).While this prevents the corruption issue, it causes temp files to accumulate in
cacheDirover time, leading to unnecessary disk usage.Steps to Reproduce
uploadImages()inAnalysisRepositoryImplcacheDirare never cleaned upProposed Solutions
One of the following approaches should be implemented:
RequestBodyto avoid creating a temp file altogether.References
/cc @komodgn