Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix: reverseGeocoding task incorrectly returns success on error

Timothy Yin0b02ee94059f
diff --git a/server/services/pipeline-queue/manager.ts b/server/services/pipeline-queue/manager.ts
index dc969674..22559cc2 100644
--- a/server/services/pipeline-queue/manager.ts
+++ b/server/services/pipeline-queue/manager.ts
@@ -460,7 +460,7 @@ export class QueueManager {
this.logger.warn(
`[${taskId}:reverse-geocoding] photo ${photoId} not found`,
)
- return
+ throw new Error(`Photo ${photoId} not found`)
}
let latitude = payload.latitude ?? photo.latitude ?? undefined
@@ -498,7 +498,7 @@ export class QueueManager {
locationName: null,
})
.where(eq(tables.photos.id, photoId))
- return
+ throw new Error(`Missing coordinates for photo ${photoId}`)
}
const locationInfo = await extractLocationFromGPS(
@@ -506,14 +506,18 @@ export class QueueManager {
longitude!,
)
+ if (!locationInfo) {
+ throw new Error(`Failed to extract location from GPS coordinates (${latitude}, ${longitude}), maybe network issue?`)
+ }
+
await db
.update(tables.photos)
.set({
latitude: latitude!,
longitude: longitude!,
- country: locationInfo?.country ?? null,
- city: locationInfo?.city ?? null,
- locationName: locationInfo?.locationName ?? null,
+ country: locationInfo.country ?? null,
+ city: locationInfo.city ?? null,
+ locationName: locationInfo.locationName ?? null,
})
.where(eq(tables.photos.id, photoId))