feat: extend offline queueing to all quick-capture forms

Only Durchsicht had an offline fallback (queue to IndexedDB, sync on
reconnect); Behandlung, Fütterung, Varroamessung, Schwarmkontrolle and
Ernte just failed outright with no signal - exactly the situation a
beekeeper is in at the actual hive. Generalizes lib/offline/db.ts and
sync.ts to six queues (version-bumped IndexedDB schema, existing queued
inspections preserved), wires the same "server rejected it vs. no
network" fallback into all five remaining */new pages, and updates the
sync badge to count/drain all six.

Also: doc-hygiene pass (ARCHITECTURE.md/TASKS.md) to replace the stale
pg_dump/CronJob backup plan with the in-app BackupModule that actually
shipped earlier this session.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Sonnet 5 committed 2026-09-05 17:45:32 +02:00
1 parent ac45514356
commit 1f67cd5548
11 files changed
+297 -46

No files matched your search

@@ -11,6 +11,19 @@ vi.mock("@/lib/inspections/api", () => ({
vi.mock("./db", () => ({
getPendingInspections: vi.fn(),
removePendingInspection: vi.fn(),
// The other five queues are exercised by their own dedicated tests
// elsewhere; here they just need to resolve empty so runSync()'s
// Promise.all doesn't touch their (unmocked, real) create functions.
getPendingTreatments: vi.fn().mockResolvedValue([]),
removePendingTreatment: vi.fn(),
getPendingFeedings: vi.fn().mockResolvedValue([]),
removePendingFeeding: vi.fn(),
getPendingVarroaMeasurements: vi.fn().mockResolvedValue([]),
removePendingVarroaMeasurement: vi.fn(),
getPendingSwarmControlChecks: vi.fn().mockResolvedValue([]),
removePendingSwarmControlCheck: vi.fn(),
getPendingHarvests: vi.fn().mockResolvedValue([]),
removePendingHarvest: vi.fn(),
}));
const mockedCreateInspection = vi.mocked(createInspection);