Ok, sorry about the delay - had to take a break and patch against the latest vulnerability in a ubiquitous logging framework…
I’ve taken time to put together relevant portions of the current code base. It’s a bit inconsistent in style and relies on both async/await and raw promises because I began the project with the latter, but quickly realized that the former suits my needs better.
[Oh wow, turns out pasting code snippets here is rather difficult as parser keeps on seeing URLs in my code. Let’s try with gist then]
https:// gist. github .com/em-ex/9be93e5a2dc4a88e3bc1b781a780ca82
The provided code fails with ‘undefined’ message 99% of times when it’s being called via incoming webhook from the third party platform. Yet it works fine if I execute it within backend or in preview mode with the same parameters. It seems to always work if I resend the same hook from different host using CURL… I’m not sure how the IP address of a third party API endpoint can play any role in this though - the hook DOES arrive, I see all my debug strings in logs.
Please let me know if you spot anything suspicious or need more details. Thanks!