Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Cache] Prevent fatal errors on php 8 when running concurrently with TagAwareAdapter v6.1#46143

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@sbelyshkin
Copy link
Contributor

QA
Branch?4.4 - 5.3
Bug fix?no
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR

This fix prevents fatal errors which may arise during rolling updates when TagAwareAdapter is upgraded from versions prior to 5.4 to the latest 6.1. TypeErrors occur because of different value types for tag versions and rules for numeric strings in php 8.xhttps://www.php.net/manual/en/language.types.numeric-strings.php

if (isset($invalidatedTags[$tag])) {
$invalidatedTags[$tag] =$version->set(++$tagVersions[$tag]);
}
if (!\is_int($tagVersions[$tag])) {

Choose a reason for hiding this comment

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

on the line above, we have a++ on this entry, shouldn't we check for this earlier?

RSickenberg reacted with thumbs up emoji
Copy link
ContributorAuthor

@sbelyshkinsbelyshkinApr 22, 2022
edited
Loading

Choose a reason for hiding this comment

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

++ operator works with strings
Although it not always changes string values (and thus no invalidation occurs in those cases) but at least it doesn't do the fatality.

nicolas-grekas reacted with thumbs up emoji
@xabbuh
Copy link
Member

Can we add a test to prevent future regressions?

@sbelyshkin
Copy link
ContributorAuthor

I've added a few tests. Please let me know if they make sense.

@nicolas-grekasnicolas-grekas changed the title[Cache] Prevent fatal errors in php 8.x[Cache] Prevent fatal errors on php 8 when running concurrently with v6.1Apr 25, 2022
@nicolas-grekasnicolas-grekas changed the title[Cache] Prevent fatal errors on php 8 when running concurrently with v6.1[Cache] Prevent fatal errors on php 8 when running concurrently with TagAwareAdapter v6.1Apr 25, 2022
@nicolas-grekas
Copy link
Member

Thank you@sbelyshkin.

@nicolas-grekasnicolas-grekas merged commitff578de intosymfony:4.4Apr 25, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@sbelyshkin@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp