strautomator / core

Strautomator Core
MIT License
41 stars 5 forks source link

Bug: Automation keeps getting disabled #36

Closed btholt closed 10 months ago

btholt commented 11 months ago

I have an automation to mark my Peloton rides as virtual rides, assign the correct bike, and change it to a virtual ride. It seems every time I come back to the site (daily, after I do my workouts) the automation has disabled itself.

JSON of automation is

{
    "conditions": [
        {
            "property": "trainer",
            "value": true,
            "operator": "=",
            "friendlyValue": "Yes"
        },
        {
            "property": "sportType",
            "value": "Ride,GravelRide,MountainBikeRide,EBikeRide,EMountainBikeRide,VirtualRide",
            "operator": "=",
            "friendlyValue": "Ride or Gravel Ride or Mountain Bike Ride or E Bike Ride or E Mountain Bike Ride or Virtual Ride"
        }
    ],
    "actions": [
        {
            "type": "sportType",
            "value": "VirtualRide",
            "friendlyValue": "Virtual Ride"
        },
        {
            "type": "gear",
            "value": "b13183031",
            "friendlyValue": "Peloton Bike+ (bike)"
        },
        {
            "type": "workoutType",
            "value": 12,
            "friendlyValue": "Ride: Workout"
        }
    ]
}

The ID of my automation is r64f8aa4f. Am I doing something wrong here or is it a bug?

igoramadas commented 11 months ago

I had a look on the logs, but could not find anything wrong. Automations will get automatically disabled if they fail too many times in a row, but that's not the case here.

I have removed the "disabled" flag from the automation. Please let me know if it happens again.

I suspect it could be cache related - and if this is the case, I'll need to figure out what's preventing your user data to be automatically updated. Can you maybe logout and login again just to be sure?

btholt commented 11 months ago

Logged out and in again. I'll leave this issue open for a week and let you know if it happens again. Otherwise we can close it.

btholt commented 11 months ago

Happened again with this ride

https://strava.app.link/khFqOY7OJDb

I haven’t touched anything if you want to take a look.

igoramadas commented 11 months ago

Found the issue. That recipe was failing when it was created, so it got a high failure count, but there's a corner case preventing the counter to be reset when the recipe executes successfully. So each time it executes, it will get disabled because the failure count is too high.

I'll fix it tonight.

btholt commented 10 months ago

Has worked several times now. Closing as fixed, thank you!

btholt commented 10 months ago

It happened again 😓

https://strava.app.link/Q7wkKyoqXDb

igoramadas commented 10 months ago

My bad.

I forgot to switch the Cloud Functions to the new deployment. Switching them in a few minutes.

btholt commented 10 months ago

No problem! Thank you! Worked again this morning.