-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DoctrineBridge] Fix LockStoreSchemaListener not working properly with iterable objects #54407
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
Conversation
barton-webwings
commented
Mar 26, 2024
•
edited
Loading
edited
Q | A |
---|---|
Branch? | 6.4 |
Bug fix? | yes |
New feature? | yes |
Deprecations? | no |
Issues | Fix #54406 |
License | MIT |
Hey! Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "7.1 for features / 5.4, 6.4, or 7.0 for bug fixes". Cheers! Carsonbot |
I think you can simply revert #50761:
|
…tener` raised by `StoreFactory`" This reverts commit 0acd403.
/cc @alexandre-daubois FYI |
Indeed my solution doesn't work as expected. I don't think that reverting the PR is the best solution, because it would fix a bug but reintroduce one in the codebase. I'm on my phone right now but I can have a look at it tomorrow to find/have a look for a proper solution, if you need help 🙂 |
I think there could be a better solution to the original issue #50761. Personally, I would take a similar path to Monolog's This way we would avoid the |
Seems to be a great solution indeed, I like it! |
I pushed a draft of my proposed solution into this PR, hopefully I didn't miss anything. Since the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a clean solution like this 😊
So, that's a new feature now, isn't it? |
Not really a new feature. The current implementation is broken. It will not add the required schema as described in #54406. Just faced the same issue and this PR fixes it :) |
The #50761 revert is a fix. |
* | ||
* @author Pavel Bartoň <[email protected]> | ||
*/ | ||
class NullStore implements BlockingSharedLockStoreInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing this class (as well as the changes to the StoreFactory
) must be moved into a separate PR targeting the 7.2
branch. That's a new feature.
@@ -40,20 +39,4 @@ public function testPostGenerateSchemaLockPdo() | |||
$subscriber = new LockStoreSchemaListener([$lockStore]); | |||
$subscriber->postGenerateSchema($event); | |||
} | |||
|
|||
public function testPostGenerateSchemaWithInvalidLockStore() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test should be kept as fixing the issue #50761 tried to fix is legitimate
} | ||
|
||
$store->configureSchema($event->getSchema(), $this->getIsSameDatabaseChecker($connection)); | ||
} catch (InvalidArgumentException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we still need catch the exception to not reintroduce the bug that #50761 tried to fix
OK, so where do we go from here? Keep the current bug in 6.4, revert the commit that causes the bug and having the issue it tried to fix again or something else? |
I would be okay with both solutions. Either reverting #50671 or switching to |
I am closing this PR, as it is superseded by #57944. |
…Cat) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [DoctrineBridge] Fix the `LockStoreSchemaListener` | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #54406 | License | MIT #54407 got sidetracked ~and `@barton`-webwings seems no longer active on GitHub~ so this PR takes over. Commits ------- db070a1 [DoctrineBridge] Fix the `LockStoreSchemaListener`