Sync doesnt sync in real time anymore

Hi. I was happily using “Sync and Watch Contract Events” to watch a contract in rinkeby. It was working flawlessly, almost real time!
Then I made some changes to the contract and I deployed and updated everything to make it work.
Everything is the same but now it takes like 4 minutes to sync in each browser ( i mean to show the create subscription event in each user’s browser).

Any ideas?
PS. my server is 4awmj3mczjmy

Did you recreate (not update) the sync for your new contract? Try restarting your server.

The event arrives faster in the database? You can look at creation time

yep. tried both… still doesnt sync fast.

I looked at creation time in terminal.
The tx is listened by the server in real time, but it is written to the db three to four minutes later.

it is written twice in db, once with confirmed false and once with confirmed true

OK! so, if I understand correctly, before, the synced tx was written into DB with a “confirmed” false flag, thats why It seems to be done in real time.
Now, the tx is synced and written into DB after the tx is confirmed. Thats why It takes like two or three minutes.

How can I change this new behavior?. I need the tx to be written with “confirmed” false flag…

it may depend on the code that you use now, how do you get that event?

1 Like

Thanks cryptokid for the responses.
But this is going a little deeper :

  • I discovered that when I make a transaction through REMIX directly , the server show a Log meaning the table in the db was written (with “confirmation” FALSE flag. ). After some minutes it flags the confirmation as true. This works flawlesly and real time.
  • IF if make the transaction through the UI, from client browsers, then the server listens to the tx, but it does not write it in the table’s DB, until its confirmed a couple minutes later…

I dont get what may be going on exactly…

What you mean with doing a transaction through the UI?

For UI, I mean: through a web browser running a this webpage im developing which calls metamask…

This behaviour is consistent? Which chain is this on? You can post both transaction hashes.

The transaction is made with the same wallet address?

if the transaction is on chain, it shouldn’t matter how it was done

1 Like

However the problem remains the same.
When I make the tx interacting with the contract through REMIX, the moralis’server DB is written with “cofirmed” false flag.
When I do the same thing from my UI (a DAPP), moralis’s server DB is only written after confirmation is true, which means three to four minutes after the tx is done.

Just to clarify, in both cases I use metamask as wallet to make the tx, just that in the first example I use REMIX, and in the second I use my DAPP.

I tested several times now. I still dont know what the heck is going on with this weird behaviour :man_shrugging: … Im still stucked.

Are you using the latest Moralis SDK for your app (+ react-moralis)? And try updating your server if you haven’t.

Nope, no react, im using just vainilla.
Im using the last moralis server version.

Can you share your serverUrl. Have you tested on another testnet?

I get the normal behaviour in vanilla JS (executeFunction) for a Goerli contract with my server (initially with confirmed: False).

1 Like

it should be no difference between those two cases

1 Like