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

Multiple uploads of the same data #38

Merged
merged 1 commit into from
Apr 7, 2022

Conversation

ossgeek314
Copy link

This patch should address issues of the same data being uploaded to Garmin if the sync is run multiple times per day as mentioned in issue #23

It stores the timestamp of the last time the sync was run in the Withings user config file if no --fromdate/-f is provided on the command line.

I've only done light testing, there might be edge cases not accounted for in the code.

I'm not sure how Garmin/Withings deals with timezones, so there might need to be timezone shenanigan added as well.

@mwhrtin
Copy link

mwhrtin commented Jul 22, 2021

I'm having trouble with duplicate entries being uploaded to Garmin, any chance of this being merged any time soon?

@mikehhhhhhh
Copy link

just a nudge @jaroslawhartman incase you haven't seen this.

It would be great to get this merged and into the docker images!

@embear
Copy link
Contributor

embear commented Nov 2, 2021

I also would like to see this merged. But if I understand the patch correctly the withings.setLastSync() is called unconditionally from the result of the actual upload. If either Garmin or TrainerRoad upload fails it will never be tried again. In my opinion it should only be called if all requested upload destinations completed with no error.

@longstone longstone linked an issue Mar 31, 2022 that may be closed by this pull request
@longstone
Copy link
Collaborator

longstone commented Apr 3, 2022

I also would like to see this merged. But if I understand the patch correctly the withings.setLastSync() is called unconditionally from the result of the actual upload. If either Garmin or TrainerRoad upload fails it will never be tried again. In my opinion, it should only be called if all requested upload destinations are completed with no error.

@embear I see the scenario, where sync failed but lastSync is written. In this case, the state could manually be fixed, setting the fromDate. Also, we would need to define what happen if TR was successful and Garmin was not. I think either persisting the last successful Sync to System instead of from?

Do you think we can take this risk and go merge?

@embear
Copy link
Contributor

embear commented Apr 5, 2022

I think that persisting the information to which destination the upload was successful would be the right way, at least for my use case. It would be best to check if there is some destination that had not been updated and download data from withings only if this is the case.
I'm not sure if this should be changed before the merge.

@longstone
Copy link
Collaborator

I'm going to merge this. To implement the behaviour as desired for the case with both endpoints, I've opened a Issue: #61

@longstone longstone merged commit d930e1c into jaroslawhartman:master Apr 7, 2022
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.

Is the command idempotent?
5 participants