organicmaps/iphone/Maps/Core
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
..
BackgroundFetchScheduler Minor warning fixes 2022-04-15 19:42:44 +02:00
DeepLink [ios] open Menu and Settings screens with highlighting the features 2024-10-04 10:34:08 +03:00
Editor [iOS] Fixed compilation errors. Removed social networks authentication with WebView 2024-04-04 08:45:39 +03:00
EventListening [ios] Fixed XCode warnings 2024-03-21 23:45:12 +01:00
Framework [android-auto] Fix turn directions 2024-08-06 11:18:46 -03:00
iCloud [ios] [icloud] skip file recreaion during the update event from the icloud 2025-01-16 22:58:28 +04:00
InappPurchase/Impl [core][ios] Cleaned up Booking, guides, ugc, taxi 2021-04-22 08:11:07 +03:00
Location [ios] add checkLocationStatus to the LocationManager 2024-09-03 18:26:15 +02:00
NetworkPolicy [iOS] fix mobile internet "Today" permission 2020-01-13 12:04:14 +03:00
Routing [ios] split logic for the closing the PP and show/hide side buttons 2024-06-18 23:18:59 +02:00
Search [ios] remove hardcoded CoreApi-swift.h to allow xcode generate a swift bridge (#9594) 2024-11-01 14:22:34 +04:00
Settings [core] Implement products configuration (#9695) 2024-11-25 12:32:01 -03:00
Storage [iOS] fix download button in PP Action Bar 2020-03-19 10:20:30 +03:00
TextToSpeech [ios] Configure audio session once with AVAudioSessionModeVoicePrompt 2024-08-20 13:07:06 +02:00
Theme [ios] refactor styles to make them type-safe using enums instead of string lit 2025-01-16 16:02:29 +04:00
TrackRecorder [ios] pass state enum+trackRecordingInfo instead of Bool to the TR callback 2024-12-24 12:12:53 +00:00
WebImage [iOS] fix bugs related to images from web 2019-01-15 18:32:11 +03:00