Closed onefastsnail closed 4 years ago
Well, the working demo worked to manually sync my existing activities for the last week! 👍
Awesome! And thanks for the feedback @hugovk, will get onto these changes tomorrow 😄.
Currently putting a fix onto #32 to query the Strava APIs only once the updateToken
method has resolved, ie with a token. BRB 😄
Any further input on this @jaamo, @hugovk and @Mattti0? 😄
I've started using the demo site each day to manually sync.
Awesome!
I guess there's no cron on the demo site, either that some missing settings or a bug in updating each day.
Yeh the worker was disabled as it would eat away at my Heroku allowance 😅. It is now running and will run a sync at 22:00 tonight if you want to test this @hugovk?
It is now running and will run a sync at 22:00 tonight if you want to test this @hugovk?
Yes, will report back!
Turned out I created an issue regarding a lack of persisting the user token to the DB which now seems kind of obvious 😅 and the usage of the newly generated token once the promise resolves, all of which have been fixed and deployed to both UAT and LIVE environments of the demo site.
The worker did run at 22:00 as intended, looped through the users in the test DB, all of which failed to query the Strava API due to invalid tokens. So debugging locally and running a local worker with this fix, all worked and sync all test DB users.
Seems like it has automatically synced also my data to Kilometrikisa! Last time I logged to site was maybe about week ago. Thanks!
👍 Yesterday's 18:00 ride has been synced fine to Kilometrikisa.
Thanks for the feedback @Mattti0 and @hugovk.
I just ran the worker on the new production demo environment and it synced all the DB users activities, and testing my Kilometrikisa data, all looks 👌 this morning.
And @Mattti0's token refresh fix worked perfect to update the short-lived access tokens.
If all ok with everyone, I will merge this to master and speak with @jaamo to update the DNS.
Thanks for all your help! 😄
The new setup has been working well so far!
I have a gap for the 1-22 January, would it be possible to set up a demo site to sync those dates? Or do you have instructions on how to set it up locally to do so?
Thanks!
Changes
No real code changes or code improvements but rather focusing on developer experience and helping the overall maintenance of the project by creating a simpler easy stack to develop with. Allowing others to contribute more easily, hopefully 😅 .
This sat on machine for quite sometime, only until recent activity i then was reminded i had this, so here we go... 😄
The Prettier change makes this PR slightly harder to look at, should have done this in a new PR, my bad.
The unchecked items i figured would be best in a separate PRs and not further extend this chaotic PR.
I have a working demo at https://strava2kilometrikisa.herokuapp.com with the pipelines implemented.
The flow would go as follows:
I originally tried to detach the sync to a scheduled event, but our sync service requires X time per registered user whilst syncing, so such a call could take minutes and only grows with users, where the worker feels more capable in this use case. However the daily restart of Heroku dynos may occur during a sync, for now i would suggest to run the sync twice a day to at least get a successful sync once a day. The API rate limits "should" be fine 😅 .
Both demo versions use a test MongoDB so feel free to spam and test. Sync is 4am on both environments.
Moving forward