Moralis Streams Issue from data type isSold column datatype define boolean but get the data in String datatype

{
“anonymous”: false,
“inputs”: [
{
“indexed”: false,
“internalType”: “address”,
“name”: “tokenAddress”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “address”,
“name”: “seller”,
“type”: “address”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “price”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “tokenId”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “uint256”,
“name”: “offerId”,
“type”: “uint256”
},
{
“indexed”: false,
“internalType”: “bool”,
“name”: “isSold”,
“type”: “bool”
}
],
“name”: “artworkAdded”,
“type”: “event”
}

hi please infrom about the issue as i am getting wrong data type

what do you mean with getting wrong data type?
where do you get that data type?

what do you do?

Get the stream data in string form but the same contract address sync function get the data in boolean datatype.

Same data get in Moralis syncs and Parse server use Stream but moralis syncs get isSold data in boolean and parse server streams get the data in String form.

You could check and update the function that adds the streams data to the database in a self hosted server. You can change the types there if you want.

But you may have to try with a new table as the type seems to be already defined for this table

here the type is boolean but stream api get wrong datatype after I change the manual data type so stream api did not get the data

This is the abi. How does the raw data that you receive from the webhook looks like?

I am using ngrok

https://fc41-39-57-241-60.in.ngrok.iongrok

{“className”:“ArtworksoldLogs”,“error”:{“code”:111,“message”:“schema mismatch for ArtworkforsaleLogs.isSold; expected String but got Boolean”},“level”:“error”,“message”:“afterSave failed for ArtworksoldLogs for user undefined:\n Input: {“name”:“artworkSold”,“logIndex”:8,“transactionHash”:“0x522957a462773bab9d3e559ef2e6785a006cf4667cd7d2962ffa5f561ace805d”,“address”:“0xd148e8657adc21dd73a555e33062e8140aadb7d0”,“blockHash”:“0x38b60df5ca516cb47edf02e80455451633bd94a7b03efffa1c589b39ed840954”,“blockTimestamp”:1671694666,“blockNumber”:25672099,“confirmed”:true,“chainId”:97,“buyer”:“0x824b92d62a838aaec0a4634bcc5e1150618adc39”,“offerId”:“225”,“price”:“20000000000000000000”,“tokenAddress”:“0x367f5603880ef354af504ef0c5f5b09346e5195b”,“tokenId”:“268”,“offer”:{”__type":“Pointer”,“className”:“ArtworkforsaleLogs”,“objectId”:“0eVKF8CQ35”},“createdAt”:“2022-12-22T07:37:48.331Z”,“updatedAt”:“2022-12-22T07:38:43.231Z”,“objectId”:“JzY2BkKn2j”}\n Error: {“message”:“schema mismatch for ArtworkforsaleLogs.isSold; expected String but got Boolean”,“code”:111}",“timestamp”:“2022-12-22T07:38:43.676Z”,“triggerType”:“afterSave”}

{“code”:111,“level”:“error”,“message”:“schema mismatch for ArtworkforsaleLogs.isSold; expected String but got Boolean”,“stack”:“Error: schema mismatch for ArtworkforsaleLogs.isSold; expected String but got Boolean\n at SchemaController.enforceFieldExists (E:\Moalis Self Hosting\Moalis Self Hosting\parseAWS\node_modules\parse-server\src\Controllers\SchemaController.js:1112:15)\n at SchemaController.validateObject (E:\Moalis Self Hosting\Moalis Self Hosting\parseAWS\node_modules\parse-server\src\Controllers\SchemaController.js:1261:28)\n at processTicksAndRejections (node:internal/process/task_queues:95:5)”,“timestamp”:“2022-12-22T05:57:19.841Z”}

it looks like it is an error the other way? it expects a string but gets bool?

in our pervoius morralis sync it’s worked fine the same abi and gets bollean but in the stream api key it’s get string

where is the issue? if you start with an empty table you still get issue?

yes when we start with an empty table same issue because stream api key create the table and data

hi please tell us about the issue

I don’t completely underhand where is the issue. Where do you get an error?
Even if is a string, what is the issue with the string?

How was that table created in the first place?

is there an afterSave trigger?