Skip to content

[HttpFoundation][Lock] Ensure compatibility with ext-mongodb v2 #58619

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

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Oct 21, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues -
License MIT

The extension mongodb and the library mongodb/mongodb will soon have a version 2.0 that brings breaking changes (see extension changes and library changes). This PR ensures compatibility with the upcoming version for Symfony 5.4.

@carsonbot

This comment was marked as outdated.

@carsonbot carsonbot changed the title Ensure compatibility with mongodb v2 [HttpFoundation][Lock] Ensure compatibility with mongodb v2 Oct 21, 2024
@GromNaN GromNaN marked this pull request as ready for review October 21, 2024 20:14
@GromNaN GromNaN requested a review from jderusse as a code owner October 21, 2024 20:14
@carsonbot carsonbot added this to the 5.4 milestone Oct 21, 2024
@GromNaN GromNaN changed the title [HttpFoundation][Lock] Ensure compatibility with mongodb v2 [HttpFoundation][Lock] Ensure compatibility with ext-mongodb v2 Oct 21, 2024
@@ -268,7 +268,7 @@ public function exists(Key $key): bool
'$gt' => $this->createMongoDateTime(microtime(true)),
],
], [
'readPreference' => new ReadPreference(\defined(ReadPreference::PRIMARY) ? ReadPreference::PRIMARY : ReadPreference::RP_PRIMARY),
Copy link
Member Author

Choose a reason for hiding this comment

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

The existing code is incorrect: it checks the existence of the constant value. See the conversation why this condition was added: #37140 (comment)

This was removed in 6.4 by bc24cb3#diff-d0f7d4ac57862532ef468d4fa38f1879eeb1c6e6f142118ecfa28dba891601b4L266

@nicolas-grekas
Copy link
Member

Thank you @GromNaN.

@nicolas-grekas nicolas-grekas merged commit b756c5e into symfony:5.4 Oct 22, 2024
11 of 12 checks passed
@GromNaN GromNaN deleted the mongodb-v2 branch October 24, 2024 19:54
nicolas-grekas added a commit that referenced this pull request Oct 25, 2024
This PR was merged into the 6.4 branch.

Discussion
----------

[Lock] Ensure compatibility with ext-mongodb v2

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Same as #58619 for branch 6.4 that was reworked by #52336

Commits
-------

cd3b778 Ensure compatibility with ext-mongodb v2
This was referenced Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants