How do I cancel a fetch request

I’m stuck trying to figure out how to cancel a http fetch request. have tried using the standard JS fetch abort controller as per javascript - How do I cancel an HTTP fetch() request? - Stack Overflow however it does not work within the journey app.

Hi @martin

Unfortunately the JourneyApps runtime does not support the AbortController interface.

Do you have to execute your fetch request from the runtime or could you “proxy” your request via CloudCode? I guess, are you making requests over the local network, if not, you should be able to use CC instead and in CloudCode you should be able to find a way cancel the fetch request

PS. We will investigate the CC based fetch cancel once you confirm you don’t have to make the call directly from the app

Hi Tielman

The request unfortunately is over the local network port to control a POS terminal.

All local network call (to my surprise) actually fine from the journey apps container, with the exception of aborts.

Any possibility of a user set timeout on the request e.g. 10sec?

Regards,
Martin

Unfortunately not, at least not at the moment. But please add this as a feature request to our Public Roadmap for consideration in future runtime releases