Skip to content

Fix Running activity type#79

Open
diegoevangelisti wants to merge 1 commit into
Pythe1337N:masterfrom
diegoevangelisti:fix-activity-type-error
Open

Fix Running activity type#79
diegoevangelisti wants to merge 1 commit into
Pythe1337N:masterfrom
diegoevangelisti:fix-activity-type-error

Conversation

@diegoevangelisti

@diegoevangelisti diegoevangelisti commented Jun 23, 2024

Copy link
Copy Markdown

Minor fix for Running activity type since it was defined as street_running but it needs to be running instead.

BEFORE

Request

app.get("/activities", async (_, res: Response) => {
  try {
    const activities = await GCClient.getActivities(
      0,
      10,
      ActivityType.Running // "running_outdoor"
    );
    res.status(200).send(JSON.stringify(activities));
  } catch (e) {
    res.status(400).send(e);
  }
});

Response:

ERROR: (400), Bad Request, {"message":"Activity type cannot be an activity sub type","error":"BadRequestException"}
Screenshot 2024-06-23 at 21 47 14

AFTER

Request

app.get("/activities", async (_, res: Response) => {
  try {
    const activities = await GCClient.getActivities(
      0,
      10,
      "running"
    );
    res.status(200).send(JSON.stringify(activities));
  } catch (e) {
    res.status(400).send(e);
  }
});

Response:

Screenshot 2024-06-23 at 21 46 53

GeorgeTG added a commit to GeorgeTG/garmin-connect that referenced this pull request Apr 12, 2026
- ActivityType.Running: 'street_running' → 'running' (was using the
  sub-type value instead of the parent type key, causing getActivities
  with ActivityType.Running to return wrong results)
- getLocalTimestamp: replace double new Date() round-trip with
  toLocaleDateString/toLocaleTimeString('sv') approach which correctly
  applies the timezone without lossy locale string re-parsing
  (fixes updateWeight logging entries at wrong timestamps)

Fixes upstream issues Pythe1337N#79 and Pythe1337N#82

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant