Skip to content

Raw Wi-Fi weight-only record can duplicate or block the later full body-comp record #48

Description

@sturimcode

Follow-up from #46 (raw Wi-Fi parser) and #2.

What happens

The raw Wi-Fi fallback now syncs a weight-only measurement when the normal pull is empty (headless, phone app not opened yet). If the user later opens the app, the same weigh-in comes back on a subsequent run as a processed record carrying body fat, muscle mass, etc.

The two records get different eufy_measurement_ids when the raw endpoint's timestamp and the processed endpoint's update_time differ for the same weigh-in:

  • ids differ -> both sync. has_synced_on_date is already true (we synced the raw record that day), so the "Garmin already has data, skip" guard in sync.py does not fire, and Garmin gets a second same-day entry. A duplicate.
  • ids match -> is_synced is true, the processed record is skipped, and the user keeps weight-only and never gets the body composition.

Scope

Only affects mixed usage: headless syncing plus occasionally opening the app. A pure VPS setup that never opens the app just keeps weight-only, which is the intended behavior and not a problem.

Possible fixes

  • Give raw and processed records the same eufy_measurement_id for the same weigh-in (align on the weigh-in timestamp), then treat the later full record as an upgrade of the weight-only one rather than a new measurement.
  • Or, on seeing a processed record for a date we already synced weight-only, replace rather than skip or duplicate (needs a Garmin delete + re-add, which the library supports via delete_weigh_in).

Not urgent. Weight-only is a strict improvement over nothing for the headless case; this is about the mixed case doing the right thing.

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