laravel-nestedset icon indicating copy to clipboard operation
laravel-nestedset copied to clipboard

Saved record is not present after saving

Open robbiemoore opened this issue 1 year ago • 0 comments

I've been debugging an issue around creating a parent, and then creating the child node.

The issue has been that I get a No query results for model [App\Models\ExampleModel] 957092 when I try to save the child node (this is the parent not existing). It turns out that after I create and save the parent, that the parent does not immediately exist (a simple select query cannot retrieve it). If I then wait until the record can be found (a few seconds) and then continue, it works fine.

We now have large trees (even after scoping them). Could there be something going on where it is slow to calculate the lft and rgt fields, and performInsert is completed before the row actually has been inserted?

robbiemoore avatar Sep 06 '24 14:09 robbiemoore