You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
API Platform dev-main buffers purges on kernel.response: a failed purge after a write is a 500 again #610
The `PHPUnit (Symfony NEXT 8.2)` leg, which runs api-platform/core `dev-main` (5cb0849), fails `HttpCachePurgeFailureTest` on `main` (54f0caf) and every open PR:
`test_creating_a_resource_while_the_http_cache_is_unreachable_returns_201_logs_the_failure_and_still_publishes_to_mercure`: 500 instead of 201.
`test_purging_the_rendered_html_while_the_http_cache_is_unreachable_is_a_502_not_a_success`: 500 instead of 502.
Cause: dev-main adds `ApiPlatform\HttpCache\BufferedPurger`, flushed by `ApiPlatform\Symfony\EventListener\HttpCachePurgeBufferListener::onKernelResponse()`. The purge now runs from AP's own listener instead of inside the bundle's `HttpCachePurger`, so the bundle's #311 rule (a failed purge after a write is logged at error and swallowed; an explicit purge is a 502) no longer applies, and the `PurgeFailedException` escapes as a 500.
Not in any release yet (latest is v5.0.9). Before it ships, the bundle needs to keep #311 on it: e.g. make the bundle's purger the inner purger of the buffer, or decorate/replace the buffered purger or its listener so the failure is caught as before, and keep the explicit purge endpoints' 502. Check what upstream intends (the PR that added the buffer) and whether it offers a hook.
Fix in #618: the bundle's HttpCachePurger and HttpCacheFlusher now purge through the inner purger of API Platform's BufferedPurger (api-platform/core#8869) whenever that service decorates something, so #311 holds on dev-main and nothing changes on 4.4/5.0.x.
Activity
silverbackdan commentedon Nov 26, 2026
Fix in #618: the bundle's
HttpCachePurgerandHttpCacheFlushernow purge through the inner purger of API Platform'sBufferedPurger(api-platform/core#8869) whenever that service decorates something, so #311 holds on dev-main and nothing changes on 4.4/5.0.x.Merge pull request #618 from components-web-app/fix/buffered-purge-fa…