fix: hub-side dedup for ESP32 offline status replay (CUB-239) #13

Merged
overseer merged 2 commits from agent/dex/CUB-239-hub-dedup-replay into dev 2026-05-28 07:00:36 -04:00
Owner

Summary

Adds DB-level deduplication for ESP32 offline status replay via a UNIQUE index on status_logs(camera_id, recorded_at).

Changes

Migration 002: UNIQUE index on (camera_id, recorded_at)

  • New migration 002_dedup_unique_index.sql
  • Creates idx_status_logs_unique_entry on status_logs(camera_id, recorded_at)
  • Enforces uniqueness at DB level, closing the race-condition window

Migration system upgrade

  • Replaced the static table-existence check with a version-tracked schema_version table
  • Future migrations apply only when version > current
  • Idempotent: existing DBs with only migration 001 upgrade automatically

Build & test

  • go build ./internal/... - PASS
  • go vet ./internal/... - PASS

Related

  • CUB-239: Hub-side dedup for ESP32 offline status replay
  • CUB-230: ESP32 firmware offline buffering replay (PR #10)
## Summary Adds DB-level deduplication for ESP32 offline status replay via a UNIQUE index on status_logs(camera_id, recorded_at). ## Changes ### Migration 002: UNIQUE index on (camera_id, recorded_at) - New migration 002_dedup_unique_index.sql - Creates idx_status_logs_unique_entry on status_logs(camera_id, recorded_at) - Enforces uniqueness at DB level, closing the race-condition window ### Migration system upgrade - Replaced the static table-existence check with a version-tracked schema_version table - Future migrations apply only when version > current - Idempotent: existing DBs with only migration 001 upgrade automatically ### Build & test - go build ./internal/... - PASS - go vet ./internal/... - PASS ## Related - CUB-239: Hub-side dedup for ESP32 offline status replay - CUB-230: ESP32 firmware offline buffering replay (PR #10)
Dex added 1 commit 2026-05-23 09:02:53 -04:00
fix: hub-side dedup for ESP32 offline status replay (CUB-239)
CI/CD / lint-and-typecheck (pull_request) Failing after 11m33s
CI/CD / test (pull_request) Has been cancelled
CI/CD / build (pull_request) Has been cancelled
CI/CD / deploy (pull_request) Has been cancelled
74c8697e57
- Add migration 002: UNIQUE index on status_logs(camera_id, recorded_at)
- Upgrade migration system to version-tracked (schema_version table)
- Prevents race-condition double-inserts that application-level COUNT(*) check cannot guard against
- Complements existing application-level dedup from CUB-230
overseer added 1 commit 2026-05-28 06:59:53 -04:00
Merge branch 'dev' into agent/dex/CUB-239-hub-dedup-replay
CI/CD / lint-and-typecheck (pull_request) Successful in 8s
CI/CD / test (pull_request) Successful in 9s
CI/CD / build (pull_request) Failing after 10s
CI/CD / deploy (pull_request) Has been skipped
c2670a9f33
overseer approved these changes 2026-05-28 07:00:28 -04:00
overseer merged commit 7fcae17239 into dev 2026-05-28 07:00:36 -04:00
overseer deleted branch agent/dex/CUB-239-hub-dedup-replay 2026-05-28 07:00:37 -04:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CubeCraft-Creations/remote-rig#13