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
While working on Web Dash DApp, we were able to create an initial implementation, however, during further debugging we came across previously unknown issue that is making unable to create any more documents batch transactions.
It looks like that first 24 (or sometimes even less) documents transactions executes correctly, but then all transactions suddenly starts fails with error:
Error submitting document: Error: Identity Y6WwZ3LYETZjsekjWjoZWnSBu9o5P5MD4Z3HmVGJiYt is trying to set an invalid identity nonce. The current identity nonce is 36028797018963994, we are setting 25, error is nonce already present in past
The issue is that identityNonce and identityContractNonce is not just a number that being incremented, but rather a u64 value. However, js is not able to always correctly handle it:
Which leads to incorrect nonce being included in the further documents batch transactions, making it not possible to interact with that data contract with your identity anymore.
Javascript does have BigInt feature to properly store it without any loss, however it is not widely supported still yet, and protobufjs library did not implement it, and incorrectly casts it to number. There is one other option like protocolbuffers/protobuf#3666 (comment) to represent it as string, but unfortunately it didn't work in our setup. From what I've read the recommendation is to read as string.
Possible Solution
Patch client code, fork gRPC library or change all u64 to string in the schema
Steps to Reproduce (for bugs)
Create documents from one identity to specific data contract until you hit the nonce issue
Context
Your Environment
Version used:
Environment name and version (e.g. Chrome 39, node.js 5.4):
Operating System and version (desktop, server, or mobile):
Link to your project:
The text was updated successfully, but these errors were encountered:
Issue
While working on Web Dash DApp, we were able to create an initial implementation, however, during further debugging we came across previously unknown issue that is making unable to create any more documents batch transactions.
It looks like that first 24 (or sometimes even less) documents transactions executes correctly, but then all transactions suddenly starts fails with error:
The issue is that identityNonce and identityContractNonce is not just a number that being incremented, but rather a u64 value. However, js is not able to always correctly handle it:
Which leads to incorrect nonce being included in the further documents batch transactions, making it not possible to interact with that data contract with your identity anymore.
Javascript does have
BigInt
feature to properly store it without any loss, however it is not widely supported still yet, and protobufjs library did not implement it, and incorrectly casts it tonumber
. There is one other option like protocolbuffers/protobuf#3666 (comment) to represent it as string, but unfortunately it didn't work in our setup. From what I've read the recommendation is to read as string.Possible Solution
Patch client code, fork gRPC library or change all u64 to string in the schema
Steps to Reproduce (for bugs)
Context
Your Environment
The text was updated successfully, but these errors were encountered: