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
There's no other issue that already describes my problem.
Describe the Bug
I have 2 collections:
categories and products.
Between those 2 there is a m2m (catagories_products).
Whenever i add a product to a categorie, it will trigger a hook for all products that are already there.
I had a webhook configured on the join table and it basicly tiggered 170 times because there where 170 products in 1 categorie.
It gave a big load on Directus and the target.
To Reproduce
Create 2 collections:
Categories
products
Add a M2M to them.
Make some way to see if a hook is triggered (for example console.log(1) inside a update hook);
Now add some products to the categories and you will see it getting triggered on the join table.
Errors Shown
No response
What version of Directus are you using?
9.2.2
What version of Node.js are you using?
17.1.0
What database are you using?
Postgres 14
What browser are you using?
Chrome
What operating system are you using?
Linux
How are you deploying Directus?
PM2
The text was updated successfully, but these errors were encountered:
rijkvanzanten
changed the title
Updating a M2M causes all records to trigger an update
Updating a M2M causes all related records to trigger an update
Dec 15, 2021
rijkvanzanten
changed the title
Updating a M2M causes all related records to trigger an update
Don't trigger webhooks on nested relational updates
Dec 15, 2021
The fact that the hook fires is expected, as the actual nested item is being updated. That being said, the webhook should only be fired once for the whole (nested) relational update tree
Preflight Checklist
Describe the Bug
I have 2 collections:
categories and products.
Between those 2 there is a m2m (catagories_products).
Whenever i add a product to a categorie, it will trigger a hook for all products that are already there.
I had a webhook configured on the join table and it basicly tiggered 170 times because there where 170 products in 1 categorie.
It gave a big load on Directus and the target.
To Reproduce
Create 2 collections:
Add a M2M to them.
Make some way to see if a hook is triggered (for example console.log(1) inside a update hook);
Now add some products to the categories and you will see it getting triggered on the join table.
Errors Shown
No response
What version of Directus are you using?
9.2.2
What version of Node.js are you using?
17.1.0
What database are you using?
Postgres 14
What browser are you using?
Chrome
What operating system are you using?
Linux
How are you deploying Directus?
PM2
The text was updated successfully, but these errors were encountered: