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
Chris
06/30/2021, 5:42 PM
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
stalbert
06/30/2021, 6:01 PM
you mean they don't even show up as rejected promises?
c
Chris
06/30/2021, 6:09 PM
yep, once the separate async process launches it never report back to the original
Chris
06/30/2021, 6:10 PM
this was the scenario back in Feb when I invested a ton of time into it
s
stalbert
06/30/2021, 6:11 PM
weird. Though I admit I still don't have many use cases for server-side promises/async
c
Chris
06/30/2021, 6:16 PM
ns says it's something they wanna offer, but I suppose it's pretty tough to do this in a managed env.
s
stalbert
06/30/2021, 7:57 PM
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
Chris
07/12/2021, 7:28 PM
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.