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

[10.x] Fix duplicate conditions on retrying SELECT calls under createOrFirst() #48725

Merged
merged 2 commits into from Oct 16, 2023

Conversation

KentarouTakeda
Copy link
Contributor

fixes #48718

@KentarouTakeda
Copy link
Contributor Author

@mpyw @tonysm

I think cloning the query builder (as suggested in the PR as a possible fix) on the first attempt should resolve the issue, but we need more testing.

I checked the existing implementations, but I couldn't find any parts that seemed to be affected. If you have any ideas please let me know. I'll try to fix it.

@tonysm
Copy link
Contributor

tonysm commented Oct 14, 2023

This is exactly how I thought I'd attempt it.👍

@SakiTakamachi
Copy link
Contributor

lgtm!

Copy link
Contributor

@mpyw mpyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@GrahamCampbell GrahamCampbell changed the title fix: Duplicate conditions on retrying SELECT calls under createOrFirst() [10.x] Fix duplicate conditions on retrying SELECT calls under createOrFirst() Oct 14, 2023
@taylorotwell taylorotwell merged commit 2f88a30 into laravel:10.x Oct 16, 2023
21 checks passed
@KentarouTakeda KentarouTakeda deleted the fix/gh-48718 branch October 16, 2023 22:28
timacdonald pushed a commit to timacdonald/framework that referenced this pull request Oct 24, 2023
…ateOrFirst()` (laravel#48725)

* fix: duplicate conditions with `firstOrCreate` and `createOrFirst`

* fix: missing mocks due to additional code
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.

[Known Issue] Duplicate conditions on retrying SELECT calls under createOrFirst()
5 participants