Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Fix sync is running touch query twice #51984

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

Tofandel
Copy link
Contributor

@Tofandel Tofandel commented Jul 2, 2024

The sync method is running touch operations twice if there is items to detach, which duplicates update queries

As we can see a little bit further in the sync method

        if (count($changes['attached']) ||
            count($changes['updated']) ||
            count($changes['detached'])) {
            $this->touchIfTouching();
        }

So the sync method already takes care of touchIfTouching so we do not need to run it in detach

@driesvints driesvints changed the title Fix sync is running touch query twice [11.x] Fix sync is running touch query twice Jul 2, 2024
@taylorotwell taylorotwell merged commit 24f3479 into laravel:11.x Jul 2, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants