You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here when the insertSurvey executes after reaching "return Promise.all(arrayOfPromisesForAssetInsertion)" the code jumps to "return "output" i.e // LINE OUTPUT. The following then statement is not reached The point // DOES NOT REACH HERE is not reached. There is no error as even catch is not reached.
Why is the DB.transaction not hitting point "console.log(valuesAfterAssetInsertion)"
The text was updated successfully, but these errors were encountered:
I've been running into this a lot recently, and it's frustrating to debug. A few things that have helped me:
awaiting the secondary executeSqls instead of using their promises.
Wrapping the secondary executeSqls in a try/catch.
Usually, this results in the error:
InvalidStateError: DOM Exception 11: This transaction is already finalized. Transactions are committed after its success or failure handlers are called. If you are using a Promise to handle callbacks, be aware that implementations following the A+ standard adhere to run-to-completion semantics and so Promise resolution occurs on a subsequent tick and therefore after the transaction commits.
I will update you when/if I figure out a solution for running insert query inside a tx.executeSql callback.
I have the following code in a function
The createDatabase enables sqlite promises
The insertSurvey code is as follows
Here when the insertSurvey executes after reaching "return Promise.all(arrayOfPromisesForAssetInsertion)" the code jumps to "return "output" i.e // LINE OUTPUT. The following then statement is not reached The point // DOES NOT REACH HERE is not reached. There is no error as even catch is not reached.
Why is the DB.transaction not hitting point "console.log(valuesAfterAssetInsertion)"
The text was updated successfully, but these errors were encountered: