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

fix(Fitbit): Improve error handling from the Fitbit API #435

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/fitbit-sync/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ func (fs *fitbitSync) getDailyActivitySummary(d time.Time) (*fitbit.DailyActivit
}

func (fs *fitbitSync) getActivityTCX(a fitbit.Activity) ([]byte, error) {
tcx, _, _, err := fs.fitbitClient.GetActivityTCX(context.Background(), fs.cfg.FitbitConfig.UserID, a.LogID, fs.cfg.Token)
tcx, _, err := fs.fitbitClient.GetActivityTCX(context.Background(), fs.cfg.FitbitConfig.UserID, a.LogID, fs.cfg.Token)
return tcx, err
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23

toolchain go1.23.4

replace github.com/anyappinc/fitbit v0.0.3 => github.com/jovandeginste/fitbit v0.0.4-0.20250213152756-feb45617b002
replace github.com/anyappinc/fitbit v0.0.3 => github.com/jovandeginste/fitbit v0.0.4-0.20250213164811-b0b3b27c3a84

require (
github.com/a-h/templ v0.3.833
Expand Down
11 changes: 2 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ github.com/alexedwards/scs/gormstore v0.0.0-20250212122300-421ef1d8611c/go.mod h
github.com/alexedwards/scs/v2 v2.4.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw=
github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
github.com/anyappinc/fitbit v0.0.3 h1:Q1yxE62uAE8D4aTBgQS+jPuvYYDJbzo0jQJXOsjOWUw=
github.com/anyappinc/fitbit v0.0.3/go.mod h1:GEs6hK/2Kqjg8VPf30j++3AsmIH8FytcnQlP6kfduII=
github.com/aquasecurity/table v1.8.0 h1:9ntpSwrUfjrM6/YviArlx/ZBGd6ix8W+MtojQcM7tv0=
github.com/aquasecurity/table v1.8.0/go.mod h1:eqOmvjjB7AhXFgFqpJUEE/ietg7RrMSJZXyTN8E/wZw=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
Expand Down Expand Up @@ -85,7 +83,6 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsouza/slognil v0.4.1 h1:fMSnRtFZgAkM7r2IuviVMj50fKgT7agXSu0JiQsM2xU=
github.com/fsouza/slognil v0.4.1/go.mod h1:uaLfvwv/vp6xUVeUEQiJ4n3L6qsGc8b/U+PANzm5Sts=
github.com/galeone/tcx v1.0.0/go.mod h1:cHrVurc4epPGjwvJt8kDkQgp4hEUhk0UiWPSN6/dykI=
github.com/galeone/tcx v1.0.1-0.20230114151622-8168e1e47884 h1:aiujMvmLqdGvZftIoDSYmTPtSVPDXC9csDpZJQ8EEkQ=
github.com/galeone/tcx v1.0.1-0.20230114151622-8168e1e47884/go.mod h1:cHrVurc4epPGjwvJt8kDkQgp4hEUhk0UiWPSN6/dykI=
github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ=
Expand Down Expand Up @@ -245,12 +242,8 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/jovandeginste/fitbit v0.0.3 h1:lpcQY7jySSRom7oTE7K6IeX6n/bxQebEE2NDhXJNue4=
github.com/jovandeginste/fitbit v0.0.3/go.mod h1:GEs6hK/2Kqjg8VPf30j++3AsmIH8FytcnQlP6kfduII=
github.com/jovandeginste/fitbit v0.0.4-0.20250213074802-01806236873e h1:voZpd5UHkmTdnfBCDfhkjtX/D/vM7NDEWlFaWTgb7tw=
github.com/jovandeginste/fitbit v0.0.4-0.20250213074802-01806236873e/go.mod h1:GEs6hK/2Kqjg8VPf30j++3AsmIH8FytcnQlP6kfduII=
github.com/jovandeginste/fitbit v0.0.4-0.20250213152756-feb45617b002 h1:kMALp2LMtvMWUin2qMMPh0X/h7BKEbYl3eVjdg2E0no=
github.com/jovandeginste/fitbit v0.0.4-0.20250213152756-feb45617b002/go.mod h1:/jNTx4kK0igJh7QNv0gaCUY8QK6B0zBPm0TdMTWricE=
github.com/jovandeginste/fitbit v0.0.4-0.20250213164811-b0b3b27c3a84 h1:VAPYoqkqXXmyH2dW8b0ZsMm3LTb66wwpIeAgln7D6PM=
github.com/jovandeginste/fitbit v0.0.4-0.20250213164811-b0b3b27c3a84/go.mod h1:GEs6hK/2Kqjg8VPf30j++3AsmIH8FytcnQlP6kfduII=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down
6 changes: 3 additions & 3 deletions vendor/github.com/anyappinc/fitbit/activity.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions vendor/github.com/anyappinc/fitbit/error.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ github.com/alexedwards/scs/gormstore
## explicit; go 1.12
github.com/alexedwards/scs/v2
github.com/alexedwards/scs/v2/memstore
# github.com/anyappinc/fitbit v0.0.3 => github.com/jovandeginste/fitbit v0.0.4-0.20250213152756-feb45617b002
# github.com/anyappinc/fitbit v0.0.3 => github.com/jovandeginste/fitbit v0.0.4-0.20250213164811-b0b3b27c3a84
## explicit; go 1.15
github.com/anyappinc/fitbit
github.com/anyappinc/fitbit/logger
Expand Down
Loading