parse-blockchain
parse-blockchain copied to clipboard
Tracking state of transactions
We need a way to track the status of the on-chain sync tx. If tx fails - how do we retry?
IDEA Could be better to have an option to sync manually so that the developer chooses him/herself when to sync and have just 1 tx to keep the state of and retry if fails.
Thanks for opening the issue.
Currently, you can track the status using the blockchainStatus and blockchainResult fields that are automatically created to any class selected to be synchronized to the blockchain. So that's the way to track and you can even use Live Query for that.
There is no way to retry though. If the transaction fails, blockchainStatus and blockchainResults will be updated accordingly and we currently do not retry the transaction. Currently, a possible way to retry it could be simply creating an afterSave trigger and, in the case of blockchainStatus is marked as failed, create a new object (which will generate another transaction).
I think there is a lot of room for improvement in this process and any ideas would be very welcome.