Back to All

SDK's triggerTransaction method seems never resolve the promise in some cases.

Web SDK

In some cases when the transaction doesn't go through (it is limited to this case at least in the limited testing we have done) in the following cases at least:

  • Not enough funds
    • Proceed anyway
      • Trade fails
        • User exits by clicking the exit button
  • Broker account does not have equity segment enabled.
    • Trades fail.
      • User exits by clicking the exit button.

The pattern seems to be that in some natural flow of interaction, due to some case, trades fail and the exit button is presented to the user and the user exits the SDK flow by clicking it.

  • In these cases, the promise on the triggerTransaction method never resolves or rejects and it is in limbo.

Some sample code for reference:

try {
    const txnRes = await sg.triggerTransaction({
      transactionId: res.data.transaction_id,
    });
    console.log("Done transacting");
    console.log(txnRes);
    // Other logic
} catch (err: any) {
    console.log("error: ", err);
    // Error handling logic
}

In the above snippet, in the cases described above, no log happens and the logic is stuck in limbo. App appears normal and the app is in focus for interaction as far as DOM elements are concerned. But control never reaches consequent logic.

Please let us know in case we're doing something wrong on our end.