Skip to content

Propagate patient update save failures from cloud sync #61

Description

@tamtam888

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions