T2: EXIF preservation fix — createAssetFromPicked() now passes original File

2026-05-21 22:23:21 -04:00
parent f801b052dd
commit 435868f240
+7
@@ -24,6 +24,13 @@ Mobile-first web app for tracking physical assets via barcode scanning, OCR stic
- Server: `ConnectLabelRequest` Pydantic model, `connect_label()` async endpoint
- Commit: 6229966
### T2 EXIF Preservation Fix (createAssetFromPicked) — May 2026
- **Bug**: `createAssetFromPicked()` used `readAsDataURL -> atob -> Blob` conversion which stripped all EXIF metadata. The manual form received an empty photo — user had to re-select.
- **Fix** (commit eaa2dab): Pass the original `pickedPhotoFile` directly — sets `manualPhotoFile` and `manualPhotoBlob` from the original File object (preserves EXIF). Uses FileReader only for preview display.
- **GPS extraction**: Calls `extractGpsFromPhoto(pickedPhotoFile)` to extract EXIF GPS coordinates and auto-fills `parking_location` + map link in manual form.
- **End-to-end**: `submitManualAsset` already reads `manualPhotoFile` with `exifr.parse()` before upload — the original File now flows through naturally, so EXIF round-trips correctly.
- **Gitea issue**: #33 — created and closed
### T5 Offline Queue + Background Sync — May 2026
- **Service Worker** (`static/sw.js`): Caches app shell (index.html) + CDN deps (Leaflet, ZXing) on install. Network-first with cache fallback for API GET calls — offline reads still work from cache. POST/PUT/DELETE pass through to the main thread. Cache version: `canteen-v2`.
- **IndexedDB offline queue** (`CanteenOfflineDB`): `queueOfflineCreate(assetPayload, photoBlob)` stores asset creation payloads with GPS data and photo blobs. Queue items tracked with status: pending/syncing/done/failed. Retry limit of 5.