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

Fix purging HTTP cache for unreadable relations #3441

Merged

Conversation

julienfalque
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tickets -
License MIT
Doc PR -

When purging HTTP Cache Tags on Doctrine flush event, API Platform uses Doctrine mapping to determine the tags to purge. When doing so it assumes all mapped associations have a public accessor on the entity but sometimes this is not true and trying to access the value throws an exception.

I assume unreadable associations can be silently ignored as it means the associated entities don't appear in serialized responses which don't have the related tags anyway.

@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch 2 times, most recently from 3e82053 to 6773a99 Compare March 13, 2020 15:18
@soyuka soyuka requested a review from dunglas March 16, 2020 10:10
@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch from 6773a99 to f4f55a5 Compare April 24, 2020 08:31
@julienfalque julienfalque force-pushed the fix-http-purge-unreadable-relation branch from f4f55a5 to 433f2a4 Compare November 1, 2020 14:06
@alanpoulain alanpoulain changed the base branch from 2.5 to 2.6 March 4, 2021 16:23
@alanpoulain alanpoulain force-pushed the fix-http-purge-unreadable-relation branch from 433f2a4 to a744e18 Compare March 4, 2021 16:23
Copy link
Member

@alanpoulain alanpoulain left a comment

Choose a reason for hiding this comment

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

LGTM

@alanpoulain alanpoulain force-pushed the fix-http-purge-unreadable-relation branch from a744e18 to 307f0a1 Compare March 9, 2021 10:27
@alanpoulain alanpoulain merged commit d362120 into api-platform:2.6 Mar 9, 2021
@alanpoulain
Copy link
Member

Thank you @julienfalque.

@julienfalque
Copy link
Contributor Author

Thank you @alanpoulain and @dunglas.

@julienfalque julienfalque deleted the fix-http-purge-unreadable-relation branch March 9, 2021 15:34
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.

None yet

3 participants