diff --git a/ios/App/App/SharedImageUtility.swift b/ios/App/App/SharedImageUtility.swift index 72cb1b64..defacc51 100644 --- a/ios/App/App/SharedImageUtility.swift +++ b/ios/App/App/SharedImageUtility.swift @@ -62,6 +62,19 @@ public class SharedImageUtility { let fileName = userDefaults.string(forKey: sharedPhotoFileNameKey) ?? "shared-image.jpg" let shareId = userDefaults.string(forKey: sharedPhotoShareIdKey) + + // Phase 1E: skip a share that has already been marked processed. + // If the current pending shareId matches the processed marker, treat it + // as if no pending share exists. Leave the file and metadata intact - + // cleanup is deferred to a later phase. + let processedShareId = userDefaults.string(forKey: sharedPhotoProcessedShareIdKey) + if let shareId = shareId, + let processedShareId = processedShareId, + shareId == processedShareId { + print("[ShareTarget] shareId=\(shareId) already processed; skipping") + return nil + } + let fileURL = containerURL.appendingPathComponent(filePath) // Read image data from file