We’ve developed a webhook that receives push notifications and does entity creation work. All has been working fine until we moved to 2022R1, where we’re seeing odd behavior during the process that is kicked off by the webhook event.
The web hook kicks off a custom long running process before returning to the caller. The webhook returns correctly, but shortly after, the site goes down and we find a PXNotLoggedInException in our Windows event logs. This feels like an instance or installation related issue, rather than a code issue. Has anyone experienced this before?
Page 1 / 1
Answering my own question so that someone else may benefit.
Working with Acumatica, we found that there was an asynchronous method in the graph code that was causing the issue.
The webhook implementation is standard, and uses a custom graph to process incoming events in a Long Running Process.
That graph implements the processing method as as an overridden pair, with a simple public member and the meat of the work done by a protected member with the same name.
Since the work involves several HTTP API calls, those methods are implemented asynchronously, carrying the async requirement up to our protected method.
Removing the ‘async’ keyword from the protected method solved the issue. It is possible that ‘await’-ing the call in the public method would have the same effect. Of course, it was necessary to await the HTTP async calls inside the method using the ‘asynchronousCall().Result’ method, rather than ‘await’.
Hope this helps anyone running into this Not Logged In exception. Asynchronous methods can cause timing issues when PXGraph code is involved.
Thank you for sharing your solution with the community @mansonj70 !