ActivityWatch / ActivityWatch/aw-client-js

String response causes TypeError in getEvents

Open
#45 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
40
Forks
20
PR merge metrics
No merged PRs in 30d

Description

I am not entirely sure how, but it seems to be possible for the axios res.data to be a string, despite the content-type being correctly set to json, causing the snippet below to error with `TypeError: n.forEach is not a function`. This happens with both aw-server and aw-server-rust, and only in Firefox.

https://github.com/ActivityWatch/aw-client-js/blob/39868c71e48a23193aed77167894917ea423f812/src/aw-client.ts#L206-L211
https://github.com/ActivityWatch/aw-client-js/blob/39868c71e48a23193aed77167894917ea423f812/src/aw-client.ts#L99-L103

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.