Skip to content

Can't get ExerciseSessions using the getChanges API #243

@lucasBruma

Description

@lucasBruma

Describe the bug
Can't get ExerciseSessions using the getChanges API, but I can get them through readRecords

To Reproduce
Steps to reproduce the behavior:

  1. Call getChanges with the ExerciseSession record type
    const changes = await getChanges({
      recordTypes: ["ExerciseSession"],
      changesToken: undefined,
    });

    console.log("getChanges result", { changes });
  1. Call readRecords with the ExerciseSession record type and timeRangeFilter
    const { records } = await readRecords("ExerciseSession", {
      timeRangeFilter: {
        operator: "between",
        startTime,
        endTime,
      },
      ascendingOrder: false,
    });

    console.log("readWorkouts records result (filtered by date range)", { recordsLength: records.length });
  1. See logs:
 LOG  getChanges result {"changes": {"changesTokenExpired": false, "deletionChanges": [], "hasMore": false, "nextChangesToken": "CNssEgEE", "upsertionChanges": []}}
 LOG  readWorkouts records result (filtered by date range) {"recordsLength": 2}

Expected behavior
If I'm not passing a changes token (because of the first sync!), I expect to have all the exercise sessions or most of them (< a month).

Also if I store the changes token received, and I execute getChanges with that token, I get the empty array again.

Environment:

  • Health Connect Version: 3.4.0
  • React Native Version: 0.79.6
  • New architecture enabled: No
  • Using Expo: Dev Client

Android API levels:

android: {
            compileSdkVersion: 35,
            targetSdkVersion: 35,
            buildToolsVersion: "35.0.0",
            minSdkVersion: 26,
            extraPropertiesFile: "gradle.properties",
            extraProperties: {
              updateRuntimeShadowNodeReferencesOnCommit: true,
              useShadowNodeStateOnClone: true,
            },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions