strautomator / core

Strautomator Core
MIT License
41 stars 5 forks source link

Automation failure when using OR operator #28

Closed ichibana closed 1 year ago

ichibana commented 1 year ago

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.

zecanard commented 1 year ago

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.

igoramadas commented 1 year ago

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

igoramadas commented 1 year ago

https://github.com/strautomator/web/commit/cabe57a152a9c9dd042d7962470f8736045260f2

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.

ichibana commented 1 year ago

Gotcha! Still need my ID? Thanks for the reply.

On Sat, May 20, 2023 at 12:18 PM Igor Ramadas @.***> wrote:

@.*** https://github.com/strautomator/web/commit/cabe57a152a9c9dd042d7962470f8736045260f2

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.

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1555975589, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOV46PO6X3TUEA4BQTDXHEKGXANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

igoramadas commented 1 year ago

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.

ichibana commented 1 year ago

Thank you Igor!

On Sun, May 21, 2023 at 12:42 PM Igor Ramadas @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1556272152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOSEG7L5XOD367Q4UFTXHJV3HANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

ichibana commented 1 year ago

Hey Igor - Just uploaded a new activity that still failed the OR flow, FYI.

Thanks, KKM

On Sun, May 21, 2023 at 13:35 Igor Ramadas @.***> wrote:

Closed #28 https://github.com/strautomator/core/issues/28 as completed.

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#event-9296559303, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOQYK4VDWCHSIV6H35LXHJ4CRANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

-- . . . . . . . . . . . . . . . Kiran K Malladi he / him https://assets2.hrc.org/files/assets/resources/TalkingAboutPronouns_onesheet_FINAL.pdf May 2023

igoramadas commented 1 year ago

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 commented 1 year ago

Hi! Sorry, I didn't follow the response.

I'm also noticing that my "trainer" automation is triggering even for Strava activities that don't meet this criteria. For example, last night I uploaded a "workout", but it still triggered the trainer automation (and at the time, didn't trigger the "core" automation).

KKM

On Mon, May 22, 2023 at 12:09 AM Igor Ramadas @.***> wrote:

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 :-)

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1556659525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOSJUFUYXBQBHCENRA3XHMGK3ANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

igoramadas commented 1 year ago

@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?

ichibana commented 1 year ago

ID 9117086090.

Thanks, KKM

On Mon, May 22, 2023 at 10:45 AM Igor Ramadas @.***> wrote:

@ichibana https://github.com/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?

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1557640709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOSKK4U7HZWQDXXDRELXHOQ3HANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

igoramadas commented 1 year ago

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?

ichibana commented 1 year ago

Ah yes, it is tagged as "indoor". But not "indoor cycling". Should I use "indoor cycling" as my trigger for the trainer?

Thanks, KKM

On Mon, May 22, 2023 at 2:40 PM Igor Ramadas @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1558053558, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOST6J76GHETAFKIZK3XHPMNBANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>

igoramadas commented 1 year ago

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.

ichibana commented 1 year ago

Thank you! Will do :)

KKM

On Tue, May 23, 2023 at 12:43 AM Igor Ramadas @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/strautomator/core/issues/28#issuecomment-1558713031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBLHOWHVM4Q7VAXM4MG3NTXHRTAPANCNFSM6AAAAAAYIMZJU4 . You are receiving this because you were mentioned.Message ID: @.***>