Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Health 11.0.0] Double step count from Health Connect when there are multiple sources and excluding manual entry #1066

Open
KWM0 opened this issue Oct 29, 2024 · 4 comments
Assignees
Labels
bugfix a bug fix

Comments

@KWM0
Copy link

KWM0 commented Oct 29, 2024

Device / Emulator and OS

  • Device: Samsung S20FE 5G
  • OS: Android 13

Describe the bug

Getting nearly double the steps when retrieve steps from health package when excluding manual entry and multiple sources (Google Fit and Samsung Health) in Health Connect.

To Reproduce

Retrieving steps from getTotalStepsInInterval and includeManualEntry: false

Expected behavior

Only retrieve the step data from 1 source when excluding manual entry

Actual behavior

Currently retrieved all the step data together from all sources (Google Fit and Samsung Health) when excluding manual entry.

Screenshots

Media
Media (1)
Media (2)
Media (3)
Media (4)

@KWM0 KWM0 added the bugfix a bug fix label Oct 29, 2024
@KWM0 KWM0 changed the title [Health 11.0.0] Double step count from Health Connect with multiple sources [Health 11.0.0] Double step count from Health Connect when there are multiple sources and excluding manual entry Oct 30, 2024
@iarata iarata self-assigned this Nov 12, 2024
@mukhtarfauzi
Copy link

is there any update?
I do have the same behavior with each health app that counts steps as well, it has more steps counted

@iarata
Copy link
Contributor

iarata commented Dec 3, 2024

@KWM0 @mukhtarfauzi The HealthDataPoint have sourcePlatform and sourceDeviceId attributes. Why you're not filtering the data points based on these attributes?

@iarata
Copy link
Contributor

iarata commented Dec 3, 2024

Also take a look at getHealthDataFromTypes() function where you can specify a list of recordingMethodsToFilter

@alvinthen
Copy link

We rely on getTotalStepsInInterval because in iOS, Apple Health will aggregate the step count if there are multiple sources (iPhone + Apple Watch). If we get manually via getHealthDataFromTypes, we will have to manually aggregate to remove duplicates, and removeDuplicates doesn't really help.

Although this is an Android issue, we are hoping that the behavior is similar to iOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix a bug fix
Projects
None yet
Development

No branches or pull requests

4 participants