We had two JS functions invoked one by one in the same execution context – ABC(..) and XYZ(..)
Both ABC(..) and XYZ(..) had methods when invoked will return promises.
ABC(..) has client.db.get(..) which can be either fulfilled F1 or rejectedR1.
XYZ(..) returns a promise to either fulfill F2 or rejectedR2.
Javascript queues F1, F2 in a microtask queue. Both callbacks F1 and F2 will be invoked only when they are fulfilled. If JS encounters R1 during execution, JS will realize promise is rejected, and the thread of execution will move to the nearest .catch(..).
In the current situation, app has expected ABC(..) -> XYZ(..) -> R1 -> F2 to happen. But JS as it should, ABC(..) -> XYZ(..) -> R1 -> .catch(..) and exits. The catch wasn’t defined so JS silently exits.
We solved this problem forcing ABC(..) -> XYZ(..) -> F1 -> F2 -> if err -> .catch(..) to happen.
Here, ABC(..) is updateEnvelopTicket(..) XYZ(..) is updateEnvelopsDocusignAll(..)
Here is the sample we shared with the developer to do #7,
This topic will automatically close in 3 days.
For any new questions we request to either create a new topic
If you are this topic creator – we already have private thread where you can ask further questions.