has anyone used https promises server side yet? I ...
# suitescript
t
has anyone used https promises server side yet? I now in some cases in node if the program finishes before the async request the request can close and not complete. wondering if it is the same for SuiteScript? It would be nice to call a suitelet and then terminate the user even to offload processing and improve performance
c
I spent quite a bit of time trying to get this work. Server side promises just aren't ready yet. The biggest problem is that errors disappear, they just don't bubble up.
👍 1
s
you mean they don't even show up as rejected promises?
c
yep, once the separate async process launches it never report back to the original
this was the scenario back in Feb when I invested a ton of time into it
s
weird. Though I admit I still don't have many use cases for server-side promises/async
c
ns says it's something they wanna offer, but I suppose it's pretty tough to do this in a managed env.
s
Usually in a server side script I want to do things sequentially, like steps 1,2,3... and step 2 depends on step 1 completion. So it's serial execution that I need. the async part is a more limited case in my experience. Maybe that's why we've gotten by without promises in NS for so long.
c
The SS 2.x pdf for 2021.1 says that server-side promises are supported for some functions. This is a major upgrade from the functionality I experienced in 2020.2. Not sure I totally trust it, but they say it's supported.