chore(occupancy): third-pass P3 follow-ups from PR #170 #276
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#276
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Third-pass P3 findings from PR #170 (spec #163). Not needed to deliver M1; none blocks merge. Earlier P3s are in #273.
app/db/database.py:866,:946:CREATE TABLE IF NOT EXISTSkeeps the old CHECK, so #171'sstatus='APPROVED'fails on a dev/validation DB that ran an earlier #170 build. Prod never had these tables. The PR also addsALTER TABLE ADD COLUMNmigrations (status_reason,is_exception,exception_name,database.py:908-917) for tables that never shipped (same dead-migration pattern as #273). Pick one: drop the branch-era ALTERs and document droppingflow_history_curation_*on dev DBs, or rebuild when the CHECK differs.prepare_curation_draft_record_async(app/db/flow_history_repository.py:900-932) re-implements the camera-mismatch, schedule-confirmed and unreviewed-days gates with broadexcept Exception. The in-lock revision check already makes them redundant; keep only the revision/status guard in the repository.HolidayHint.name: strvs the null convention from #222. Unnamed exceptions now yield""fromoccupancy_holidays.name. Usestr | Noneand normalise blank toNone.camera_index_codes: []means "all cameras".request.camera_index_codes or cameras(app/services/flow_history_service.py:1198). Reject an empty list, or treat onlyNoneas all.exception_namestale.flow_history_service.py:1095keepsday_row.exception_namewhileholiday_namechanges. Keep them in sync or drop the duplicate.runningfetch blocks draft creation. Arunningrow left by a crashed process makes POST draft return 409 (flow_history_service.py:596) until another fetch starts, because onlystart_fetch_asyncmarks dead rows interrupted. Check for a live task the same way.get_current_revision_async.MAX(revision)fromflow_history_fetches(flow_history_repository.py:398-413) exists only for test seeding that skipsflow_history_months. Seed the row in tests and drop the fallback.