strautomator/core

Automation failure when using OR operator

ichibana opened this issue · 15 comments

Hi there! I'm a big fan that Strautomator exists - thanks for making it! I've been trying to use it for a couple things - (1) auto set a bike if I'm using the trainer and (2) auto name workouts that are input as 'workout' or 'pilates'.

I'm consistently having the automation fail when using the OR operator for condition (2). If I disable the OR and only query one of the two conditions, it works.

I actually encountered the same issue recently: I wanted an automation that triggered on every activity, so I set Has location data? ‘Yes’ OR Has location data? ‘No’. The automation failed to trigger on two activities without location data. I chalked it off to my conditions being quirky, so I now use a different condition. But seems there is indeed a bug.

@ichibana can you send me your account ID please? I'll investigate.

strautomator/web@cabe57a

More details: the radioboxes to set the "samePropertyOp" is hidden from the UI when there are 2 conditions or less, as it was supposed to use the "op" in these cases instead, regardless if conditions are of the same type or not. But the value was still being pushed and saved on the recipe, even if you can't see it.

In both examples given above, you see OR on the UI but in reality the operator used was AND. Fixed now.

Will be live in production in a few hours.

Not needed, I asked in case you wanted to have it fixed manually before the deployment. But fix is ready in production now. You can simple edit the automation again, and it will automatically set the correct "samePropertyOp" flag.

Hi Kiran,

I see you update an automation recently, but it was the other one (not the Workout / Pilates), so that one still had the samePropertyOp set to AND. I've manually removed the flag from that automation for you now.

If you have any other issues, please let me know :-)

@ichibana I've followed you on Strava so I can see the activity details without having to impersonate your account via the API. Can you please let me know the workout activity ID that misfired the trainer automation?

That activity is returning "trainer = true".

Can you please open https://www.strava.com/activities/9117086090/edit and check if the "Indoor" tag is marked?

Strava doesn't make any distinctions, if it's indoor then it will have trainer = true.

On your case, you can add a second condition checking the sport type (Ride, VIrtual Ride etc). And of course, use AND as the logical operator.