Marek Kubiczek
07/20/2023, 7:50 AMdewildte
07/20/2023, 1:57 PMMarek Kubiczek
07/20/2023, 3:13 PMdewildte
07/20/2023, 3:14 PMMarek Kubiczek
07/20/2023, 3:19 PMMarek Kubiczek
07/20/2023, 3:23 PMMarek Kubiczek
07/20/2023, 3:24 PMdewildte
07/20/2023, 3:37 PMdewildte
07/20/2023, 3:38 PMdewildte
07/20/2023, 3:39 PMMarek Kubiczek
07/20/2023, 3:41 PMMarek Kubiczek
07/20/2023, 3:42 PMFabio Berta
07/20/2023, 5:10 PMMarek Kubiczek
07/20/2023, 5:22 PMFabio Berta
07/20/2023, 5:28 PMFabio Berta
07/20/2023, 5:29 PMMarek Kubiczek
07/20/2023, 5:43 PMFabio Berta
07/20/2023, 5:54 PMdewildte
07/20/2023, 7:15 PMWallpaper
and SelectedWallpaper
.
It looks to me like you just have an order of operations issue.
Is there any issue with the UseCase
doing things in this order?
1. Download the Wallpaper
data, if that succeeds then
2. Store the data to disk via the WallpaperRepository
, if that succeeds then
3. Store the SelectedWallpaper
data in the SelectedWallPaperRepository
, if that succeeds then
4. Return SelectWallpaperUserCase.Result.Success
If any one of these steps fail then you can (if needed) revert any of the data caching and return
SelectWallpaperUserCase.Result.Failure(cause)
How does that look?dewildte
07/20/2023, 7:18 PMdewildte
07/20/2023, 7:22 PMMarek Kubiczek
07/20/2023, 7:33 PMWallpaper
object, it is passed to the use case, first the use case downloads the pictures and stores them locally, then stores the Wallpaper
as a selected one with the local paths. Actually the problem here might be that the picture is always saved under the same file name, this makes it possible that when 2 usecases are run at the same time one can overwrite the other files...Marek Kubiczek
07/20/2023, 7:35 PMMarek Kubiczek
07/20/2023, 7:39 PMdewildte
07/20/2023, 7:47 PMdewildte
07/20/2023, 7:47 PMdewildte
07/20/2023, 7:48 PMdewildte
07/20/2023, 7:49 PMdewildte
07/20/2023, 7:50 PMdewildte
07/20/2023, 7:54 PMdewildte
07/20/2023, 7:55 PMdewildte
07/20/2023, 7:56 PMMarek Kubiczek
07/20/2023, 8:03 PM