Unable to delete row that is created in table populated by a contract event

I have a table that is being created from a plugin that watches a contract event which works fine. The problem is when a second row is created in that table, a duplicate of the first row created is made. It has the same information as the first but a different, longer objectId and I am unable to delete or edit anything in this row. The other difference is that it has a log_index of 5 and the rest of the rows have 0. This extra row messes up my query to the table. This only happens once and only in this certain table, my other table created from a different contract event works fine. Any ideas why this is happening?

v0.0.187
subdomain: be5g4pce1zhk

Please update to the latest Moralis server version (currently 0.0.190) and try again. There have been some fixes for sync issues. Let us know if this doesn’t fix the issue.

I am still getting the un-deletable row with a strange objectId when it is first triggered using 0.0.195. And same as before it only happens once, but still causes trouble when querying the table.

subdomain: kl1q4cedtehs

You are usng Ganache, yes? There are some issues with Hardhat right now that being looked into.

Yes I am using Ganache

Still getting that doubling effect with 0.0.200

UPDATE: I reset everything and wasn’t having any problems until I clicked “Save Plugins” again. Then it made those un-deletable copies of the rows created in my one table.

Can you post the new subdomain? Gerardo needs to know what it is so he can look into it. Thanks.

My apologies, it’s xzahwrhre9rk - 0.0.202

So now the issue seems to be adding a new plugin in general because when I do add one I keep getting CORS errors on load and am unable to load my dashboard once I add a plugin to watch a contract event. And I know it’s not related to my cloud code because I tested that for wayyy too long thinking I had a syntax error.

@gerardo15 can check out your instance for the duplicate row issue.

CORS errors are usually an indication you have an error in your cloud code. If you can’t spot the error right away remove the cloud code entirely as a temporary solution just to get the dashboard working. The CORS errors should not be happening anymore, this is something that Gerardo will want to look into as well.

I haven’t been able to recreate the duplicate row with my current instance because of the errors I get when I have the plugins in.

I tried that I didn’t have any problems when I had my cloud code in or out, I was only getting the CORS errors I logged to the console and was unable to reach my dashboard when I had a plugin I created to watch an event. Once I removed the plugins I created I wasn’t getting errors, the dashboard was available again, and the rest of my site was working just fine

Hello @_Ty

Can you share the plugin configuration values used that resulted in the CORS errors. It seems they have been removed.

Thank you

Sorry I removed them earlier but just added them back. Can you see them now or do I need to share them here still?

@_Ty it appears xzahwrhre9rk was deleted do you have a new subdomain and are you still experiencing the issue?

I reset everything yesterday, my new subdomain is tj1nvdlpxhuf. As of last night EST I have not experienced any of the errors mentioned above, they have all been resolved. I was too busy celebrating and forgot to give this update

2 Likes

Awesome, glad to hear it @_Ty

I celebrated too soon :upside_down_face:. I am now getting that uneditable doubling effect again in my one table after I changed one of my cloud functions. No CORS errors and everything is working at the moment because of a work-around line of code I am using that skips over rows that are missing a certain column that the doubling effect did not copy, but the problem is back. Subdomain: zz5cwst1ac56

@_Ty Can you clarify what is meant by uneditable doubling?

  1. Exactly the steps taken, (tables edited, rows removed, web3 action taken)
  2. The intended outcome
  3. The actual outcome

This will help me debug the issue.
Thank you

So I had everything set up everything and it was working fine ie. ganache, cloud functions, and plugins to create the tables ArtworkForSale and ArtworkSold as seen above. I then went to update one of my cloud functions to return another value I was missing. After I updated the cloud function I went back to the dashboard and noticed the six rows that populated ArtworkSold at the time, all had a double (as seen above) with a longer objectId, no input in the offer column, and I am unable to edit or delete the rows with the longer objectIds.

This only happens once, as in I went to edit my cloud functions again and did not get a double of all rows in ArtworkSold like the first time.

Let me know if I need to clarify anymore or if that was a helpful description.

@_Ty perfect I can debug from here thank you