Webhook is only sending one DB Update (afterSave) when 3 updates made at the same time

Hi there,

There are scenario’s where the DB has multiple rows inserted at the same time: Screen Shot 2022-06-18 at 7.37.08 am

What I would expect is the webhook to fire 3 times, but instead, I’m only receiving one webhook.

Please advise a solution/guidance here?

Did you add some logging in afterSave to see if it was triggered 3 times?

As a backup idea you could also set a flag when a row was successfully processed and try to reprocess with a job what was not successful.

Can you clarify what you mean here, please?

I mean if you have logging with logger.info to get more info about what happens.

There is little information in logging in the DB area.

The Webhook is setup as afterSave. Each entry is stored separately in the DB, so I am at a loss why the webhook would not fire each time.

Please provide some guidance here.

logger.info(“string”) works for logging in cloud code

Unfortunately, I am not that familiar with cloud code, not my expertise. The purpose of using Moralis and the webhook was for ease of use, but without an obvious solution/guidance as to why the webhooks are not triggering on each new row I may have to look at alternatives.

the may be an easier way for you in the near future:

it is also quite easy to connect directly to mongo db now

This isn’t really helpful for my situation now, though is it? And I don’t really want to self-host.

is there any other support channel?

how did you use the web hook? you can use afterSave web hook where you can make a http request and you can add logging there, log the errors in a table, use a flag to know when an entry was successfully sent, reprocess the entries that had errors with a job