43 lines
2.0 KiB
Plaintext
43 lines
2.0 KiB
Plaintext
JQC iOS — recurring schedules keep showing the old due date
|
|
===========================================================
|
|
Repo: jqc_ios_app iOS ONLY — no server change, no migration.
|
|
|
|
OVERWRITE (paths relative to the folder containing JanitorialQC.xcodeproj):
|
|
JanitorialQC/Models/LocalScheduledInspection.swift
|
|
JanitorialQC/Views/Dashboard/ExecuteInspectionView.swift
|
|
JanitorialQC/Views/Dashboard/ScheduledInspectionsView.swift
|
|
JanitorialQC/Views/Dashboard/MyInspectionsView.swift
|
|
JanitorialQC/CLAUDE.md
|
|
|
|
No new files, none removed, no .xcodeproj edit.
|
|
|
|
SwiftData: `fulfilledLocally: Bool = false` is a new stored property, but it is
|
|
non-optional WITH an inline default -> lightweight migration. Existing rows read
|
|
as false. NO need to delete the app from the iPad.
|
|
|
|
BUILD
|
|
Product > Clean Build Folder (Shift-Cmd-K), then run.
|
|
|
|
VERIFY
|
|
1. DAILY schedule due today. Complete + submit on the iPad.
|
|
- SCHEDULED card clears immediately
|
|
- within one sync cycle (<=60s) the row REAPPEARS showing TOMORROW
|
|
Cross-check the server agrees:
|
|
SELECT id, frequency, next_due_date, last_completed_at
|
|
FROM scheduled_inspections WHERE id = <id>;
|
|
2. WEEKLY Mon/Wed/Fri: complete on Monday -> row returns showing Wednesday.
|
|
3. MONTHLY day-of-month: complete -> row returns showing next month.
|
|
4. ONE-TIME: complete -> row clears and STAYS gone (server deactivates it).
|
|
This is the case that always worked and must not regress.
|
|
5. Offline: airplane mode, complete a daily schedule
|
|
-> card clears at once, row stays hidden while offline
|
|
-> re-enable network -> row returns with tomorrow's date
|
|
6. Failed submit: if the inspection never syncs, the row comes back with its
|
|
ORIGINAL date (still genuinely due) rather than staying hidden.
|
|
|
|
IF STEP 1 STILL FAILS
|
|
Check which side is wrong before changing the app again:
|
|
- server shows tomorrow, iPad shows today -> client, reopen this fix
|
|
- server still shows today -> fulfill() never ran; check
|
|
sudo journalctl -u janitorial_qc | grep "schedule fulfilled"
|