bug(schedule): saving unchanged weekly schedule form stages empty pending change #249

Open
opened 2026-10-03 09:11:42 +00:00 by gabogg · 1 comment
Owner

Follow-up for PR #177 (next-day settings activation, #114) addressing pass-4 review finding P3-2:

Scope

Saving the weekly schedule form when no fields have changed from active values and nothing is currently pending stages an empty WEEKLY_SCHEDULE pending change (payload = {"items": []}) and returns a "Weekly schedule saved, takes effect tomorrow" notice instead of treating the form as clean/unchanged.

Acceptance Criteria

  • When saving the weekly schedule form with no changes against active values and no pending items, do not stage an empty pending change.
  • The UI / response reports no changes pending or leaves active schedule as-is.

Refs #177, #114.

Follow-up for PR #177 (next-day settings activation, #114) addressing pass-4 review finding P3-2: ### Scope Saving the weekly schedule form when no fields have changed from active values and nothing is currently pending stages an empty `WEEKLY_SCHEDULE` pending change (`payload = {"items": []}`) and returns a "Weekly schedule saved, takes effect tomorrow" notice instead of treating the form as clean/unchanged. ### Acceptance Criteria - When saving the weekly schedule form with no changes against active values and no pending items, do not stage an empty pending change. - The UI / response reports no changes pending or leaves active schedule as-is. Refs #177, #114.
Author
Owner

Adding scope from PR #177 review pass 5 (standards P3-C), same code path. The P2-B fix copies the whole WeeklyScheduleUpdateResult / DayScheduleItem comprehension into both branches (occupancy_service.py ~448 and ~481). The ACTIVE branch also computes an effective_date for a change that was never staged. Build the result once when fixing the empty-change case.

Adding scope from PR #177 review pass 5 (standards P3-C), same code path. The P2-B fix copies the whole `WeeklyScheduleUpdateResult` / `DayScheduleItem` comprehension into both branches (`occupancy_service.py` ~448 and ~481). The ACTIVE branch also computes an `effective_date` for a change that was never staged. Build the result once when fixing the empty-change case.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#249
No description provided.