Context
During PR #60 review, we checked whether onUpdatePatient can be awaited to detect consent-save failures.
Finding:
PatientDetailsPage.jsx receives onUpdatePatient from patientsState.handleUpdatePatientInline.
handleUpdatePatientInline is async, but the current save chain does not propagate Supabase/cloud sync failures to the caller.
- Cloud upsert errors are logged and handled internally, but not surfaced to UI code.
This means adding try/catch around await onUpdatePatient(...) in a component would create fake error handling: it would not catch real Supabase failures.
Problem
Patient update flows can appear successful locally even if cloud persistence fails or is retried silently.
This affects video consent and may affect other patient update fields, not only consent.
Goal
Create a clear, reliable way for patient update callers to know whether cloud persistence succeeded, failed, or is pending.
Possible approaches
- Return a result object from patient update functions, such as
{ localSaved: true, cloudStatus: "queued" | "synced" | "failed" }.
- Surface sync failure through a central notification/toast system.
- Track per-patient pending cloud sync state.
- Avoid implying full cloud save success when only local state was updated.
Out of scope
Related
Follow-up from PR #60: video consent gate for patient media workflows.
Context
During PR #60 review, we checked whether
onUpdatePatientcan be awaited to detect consent-save failures.Finding:
PatientDetailsPage.jsxreceivesonUpdatePatientfrompatientsState.handleUpdatePatientInline.handleUpdatePatientInlineis async, but the current save chain does not propagate Supabase/cloud sync failures to the caller.This means adding
try/catcharoundawait onUpdatePatient(...)in a component would create fake error handling: it would not catch real Supabase failures.Problem
Patient update flows can appear successful locally even if cloud persistence fails or is retried silently.
This affects video consent and may affect other patient update fields, not only consent.
Goal
Create a clear, reliable way for patient update callers to know whether cloud persistence succeeded, failed, or is pending.
Possible approaches
{ localSaved: true, cloudStatus: "queued" | "synced" | "failed" }.Out of scope
Related
Follow-up from PR #60: video consent gate for patient media workflows.