Waboodoo / HTTP-Shortcuts

Android app to create home screen shortcuts that trigger arbitrary HTTP requests
https://http-shortcuts.rmy.ch
MIT License
1.17k stars 113 forks source link

[BUG] maximum recursion depth reached #343

Closed m2acgi closed 1 year ago

m2acgi commented 1 year ago

Screenshot_20230424_160004_HTTP Shortcuts

Waboodoo commented 1 year ago

This error message is shown when an infinite loop of shortcuts triggering shortcuts is detected. It is a protective measure to stop the app from becoming unresponsive or blocking the entire device. Thus, in the case of an actual infinite loop, the app is expected to show this message, meaning it's not necessarily a bug. @m2acgi Please provide more information on why you created this issue.

m2acgi commented 1 year ago

I use HTTP-Shortcuts to send files, each time a file is sent, a confirm box is poped to confirm whether to send the next one. Now, I can only send up to 6 files, and I get "maximum recursion depth reached" error. If have a option to disable this limit would be good because I know what I'm doing.

Waboodoo commented 1 year ago

I see. I'll think about whether I can loosen this restriction a bit. The main purpose of this mechanism is to prevent infinite loops which would be difficult to stop, but in your case, since you have a dialog which you could just cancel, that is of no concern.

As a workaround, you can try by adding a delay of 500 milliseconds or more to the recursive call:

enqueueShortcut('my_shortcut', null, 500);

This will reset the recursion depth counter and should allow you to chain arbitrarily many shortcut executions.

m2acgi commented 1 year ago

Perfect