fix(ingest): route by capture time, not leftover open-event pin (BIT-165) #165

Merged
spark merged 2 commits from task/BIT-165-event-routing into main 2026-11-03 17:20:53 +00:00
Owner

Summary

  • Pin (FTP target / open event) only wins while the photo's EXIF capture sits inside that event's ingest window — leftover pins no longer swallow another session.
  • When two windows overlap (studio 14:00 + Sub-21 16:30), route to the event whose startsAt is closest to the capture (not the latest calendar event).
  • No capture time → inbox (never invent "now"). Same rule on server ingest, claimInbox, desktop USB/FTP/local preview.

Test plan

  • App unit tests: offline routing, USB, LocalFtp, localIngest
  • API library tests in CI (needs DATABASE_URL_TEST)
  • After deploy: re-import a 14h Miguel card with Sub-21 open — must land on Miguel / Sem evento, not Treino Sub-21
  • Live Sub-21 shots after 16:30 still land on Sub-21 with the event open
## Summary - Pin (FTP target / open event) only wins while the photo's EXIF capture sits inside that event's ingest window — leftover pins no longer swallow another session. - When two windows overlap (studio 14:00 + Sub-21 16:30), route to the event whose `startsAt` is closest to the capture (not the latest calendar event). - No capture time → inbox (never invent "now"). Same rule on server ingest, claimInbox, desktop USB/FTP/local preview. ## Test plan - [x] App unit tests: offline routing, USB, LocalFtp, localIngest - [ ] API library tests in CI (needs DATABASE_URL_TEST) - [ ] After deploy: re-import a 14h Miguel card with Sub-21 open — must land on Miguel / Sem evento, not Treino Sub-21 - [ ] Live Sub-21 shots after 16:30 still land on Sub-21 with the event open
spark added 1 commit 2026-11-03 17:00:37 +00:00
fix(ingest): route by capture time, not leftover open-event pin (BIT-165)
ci / rust (pull_request) Successful in 4m9s
ci / typescript (pull_request) Failing after 7m29s
42912453e2
Morning studio cards (14h) were landing on the afternoon Sub-21 training when windows overlapped or the pin ignored EXIF. Pin only wins inside its ingest window; overlapping windows pick the closest startsAt; no capture time stays in the inbox.
spark added 1 commit 2026-11-03 17:11:00 +00:00
fix(ingest): keep named event when the JPEG has no capture time (BIT-165)
ci / rust (pull_request) Successful in 3m55s
ci / typescript (pull_request) Successful in 7m44s
a9ae5ce6ad
Hand/desktop uploads into an open folder (and zero-width test fixtures) have no DateTimeOriginal; dropping them into Sem evento broke autopilot. The Miguel→Sub-21 bug is the case with EXIF outside the pin window.
spark merged commit f20dea883e into main 2026-11-03 17:20:53 +00:00
Author
Owner

Merged to main as f20dea88 — deploy webhook should roll API + app.

Cause: with Sub-21 open (or FTP-pinned), morning Miguel cards (EXIF ~14h) were kept by the pin / “latest startsAt wins” even though their capture sat outside Sub-21’s window (or closer to Miguel’s start in the overlap).

Fix:

  • Pin only wins while capture is inside that event’s ingest window (+ session gap).
  • Overlapping windows → closest startsAt to the capture.
  • No EXIF → keep the named folder/pin (do not invent “now”); client optimistic grid stays in Sem evento until the server files it.

Verify after deploy / app update: re-import a 14h Miguel JPEG with Treino Sub-21 open — must not land on Sub-21. Live Sub-21 shots after 16:30 still go there.

Merged to `main` as f20dea88 — deploy webhook should roll API + app. **Cause:** with Sub-21 open (or FTP-pinned), morning Miguel cards (EXIF ~14h) were kept by the pin / “latest startsAt wins” even though their capture sat outside Sub-21’s window (or closer to Miguel’s start in the overlap). **Fix:** - Pin only wins while capture is inside that event’s ingest window (+ session gap). - Overlapping windows → closest `startsAt` to the capture. - No EXIF → keep the named folder/pin (do not invent “now”); client optimistic grid stays in Sem evento until the server files it. **Verify after deploy / app update:** re-import a 14h Miguel JPEG with Treino Sub-21 open — must not land on Sub-21. Live Sub-21 shots after 16:30 still go there.
Sign in to join this conversation.