sindresorhus / Actions

⚙️ Supercharge your shortcuts
https://sindresorhus.com/actions
MIT License
2.55k stars 107 forks source link

Frequent but random crashing of app creating menus #180

Open rastafaa opened 9 months ago

rastafaa commented 9 months ago

Description

Having an issue that seems to stem from the new create menu actions. Initially the problem seemed to be with just changing the foreground icon colors as it would return previous values til 2nd run (think related to dark mode detection action), I resolved that with a workaround eventually.. but now the shortcut randomly crashes when it’s run and it blames Actions for not responding or crashing.

I’ll attach some screenshots and a shortcut I made that it happens with.

IMG_2708 IMG_2706

Errors when creating menus which is what happens in second run of shortcut with my workaround for the dark mode detector action or menu icon color issue as mentioned before.

IMG_2719 IMG_2720

Running shortcut doesn’t always crash.. sometimes it works fine but then it’ll start throwing errors repeatedly til the app gets reset or something in background (not sure). Same issue happens with other shortcut seen in screenshots with menus.

Other shortcut with issue: https://www.icloud.com/shortcuts/dff736d8074948c2ba5e7130002ffcc6

macOS/iOS version

17.1

Shortcut URL

https://www.icloud.com/shortcuts/8cb4065ea3264a5c8631a9ee7bd393f3

rastafaa commented 9 months ago

Just fyi showing basically how the workaround works.. initial shortcut stops after dark detector and is re-run to get the action to output correct values and have icons change color, otherwise the icons will show wrong colors the first time it’s run after changing dark mode system appearance

IMG_2721

rastafaa commented 9 months ago

Here’s the action menu shortcut with the workaround thing removed for people who want to run it normally (otherwise it won’t run from within it)

https://www.icloud.com/shortcuts/f8e156d907cd422f9266b9ef3187820a

rastafaa commented 9 months ago

It stopped crashing for a bit but now it’s happening constantly again

Edit: it won’t stop crashing now with the menu item action. If I reinstall the app will I lose anything? (Global variables etc)

rastafaa commented 9 months ago

I think I somewhat solved the crashing now by adding a 50ms wait before the first menu action.. it runs without crashing after I did that.

I think somehow the app wasn’t retrieving the variable passed to the action in time before running it?

mkozjak commented 9 months ago

image

No luck. I guess I'll just wait for the patch.

sindresorhus commented 9 months ago

Try out the TestFlight, there is a potential fix there: https://testflight.apple.com/join/fJGUrsZx

mkozjak commented 9 months ago

My Shortcut ran just first time. After that it started crashing with this error:

image

Same thing happens after the iOS reboot.

image

@sindresorhus - Can I fetch you any logs somewhere?

I just realized I posted this here instead of on #190. 🤦

rastafaa commented 9 months ago

image

No luck. I guess I'll just wait for the patch.

Hm didn't get any errors when I tested on my phone. As mentioned before it might depend what phone you're using since I'm on 15 pro, if you're on slower device try increasing the delay that I added, you might need a longer one to give the extension time to reload.

mkozjak commented 9 months ago

I’m on iPhone 15 Pro too.

rastafaa commented 9 months ago

I’m on iPhone 15 Pro too.

Increase it to 70ms.. mine started crashing repeatedly again today and resolved by increasing delay

mkozjak commented 9 months ago

I’m on iPhone 15 Pro too.

Increase it to 70ms.. mine started crashing repeatedly again today and resolved by increasing delay

Are you testing this with the TestFlight version also?

rastafaa commented 9 months ago

I’m on iPhone 15 Pro too.

Increase it to 70ms.. mine started crashing repeatedly again today and resolved by increasing delay

Are you testing this with the TestFlight version also?

No I haven’t tried that yet

rastafaa commented 9 months ago

Try out the TestFlight, there is a potential fix there: testflight.apple.com/join/fJGUrsZx

Will installing this lose any data, like global variables?

sindresorhus commented 9 months ago

@rastafaa No. It's the exact same app, just a slightly newer version.

rastafaa commented 9 months ago

@rastafaa No. It's the exact same app, just a slightly newer version.

Thanks I was just checking because it does give this warning IMG_3854

rastafaa commented 9 months ago

I tried it out and didn’t get crashes yet, but I found that the menu generates significantly slower than on previous version (which is already a bit slow).. so I downgraded back to App Store release

The difference was like ~3sec vs ~5sec