organicmaps/iphone
Kiryl Kaveryn 79b4826859 [ios] [icloud] skip file recreaion during the update event from the icloud
When the user deletes the file locally with the enabled icloud happens this:
1. the file is moved to the local .Trash dir
2. the LocalDirectoryMonitor send event to delete the file from the iCloud
3. the SynchronizationFileWriter trash the remote file using the system API `try fileManager.trashItem`
4. the file is moved to the devices trash
5. the icloud sends the update to the metadataQery's `queryDidUpdate` with the updated state. This update is tricky - it calls the method twice: on the first call the deleted file appears in the updated list (`userInfo[NSMetadataQueryUpdateChangedItemsKey]`) and on the second call the deleted file appears in the deleted list (`userInfo[NSMetadataQueryUpdateRemovedItemsKey]`). There is no way to disable this behaviour.
At that point the bug can happens: the 1st `update` (that contains the file in the deleted list) call can triggers the file recreation because the synchroisztion starts to process the event and make an attempt to recreate the file but it is already deleted.

The fix is: skip missed file during the `Update` event. The case when the missed file is in the updated in undefined and should be skipped by checking the file existence.

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
2025-01-16 22:58:28 +04:00
..
Chart [ios] Automatically manage signing for AppStore 2024-12-28 23:11:04 +00:00
CoreApi [ios] Automatically manage signing for AppStore 2024-12-28 23:11:04 +00:00
DatePicker [ios] Automatically manage signing for AppStore 2024-12-28 23:11:04 +00:00
Maps [ios] [icloud] skip file recreaion during the update event from the icloud 2025-01-16 22:58:28 +04:00
metadata Release notes. 2024-11-29 19:07:41 -03:00
plist.txt [strings] Hindi translations 2024-01-16 13:03:45 +02:00
upload_to_appstore.sh Properly generate/use the same version in all places 2022-05-21 08:26:37 +02:00