Aug 27 - Fixed inspection lost photos recovery

This commit is contained in:
Nguyen Ngo
2026-08-27 10:42:01 -04:00
parent ca7c09f982
commit 308710538b
14 changed files with 794 additions and 114 deletions
+10 -2
View File
@@ -177,7 +177,11 @@ actor APIClient {
retrying: Bool = false) async throws -> String {
let url = try buildURL("/api/v1/photos/upload")
guard let imageData = FileManager.default.contents(atPath: localPath) else {
// Read via PhotoStore, not the raw path. Stored paths embed the app
// container UUID, which iOS reassigns on every app update the file
// survives, the path does not, and a raw read then fails forever on a
// photo that is sitting right there on disk (rule 91).
guard let imageData = PhotoStore.contents(at: localPath) else {
throw APIError.networkError("Could not read photo: \(localPath)")
}
@@ -385,7 +389,11 @@ actor APIClient {
retrying: Bool = false) async throws -> String {
let url = try buildURL("/api/v1/photos/upload")
guard let imageData = FileManager.default.contents(atPath: localPath) else {
// Read via PhotoStore, not the raw path. Stored paths embed the app
// container UUID, which iOS reassigns on every app update the file
// survives, the path does not, and a raw read then fails forever on a
// photo that is sitting right there on disk (rule 91).
guard let imageData = PhotoStore.contents(at: localPath) else {
throw APIError.networkError("Could not read photo: \(localPath)")
}