This PR was merged into the 8.1 branch.
Discussion
----------
[Messenger] Make $clock nullable in PostgreSqlNotifyOnIdleListener
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
This makes conditional wiring easier, as spotted in https://github.com/doctrine/DoctrineBundle/pull/2204
Commits
-------
52e6cd3f1de [Messenger] Make $clock nullable in PostgreSqlNotifyOnIdleListener
* 8.0:
[HttpKernel] Fix int-to-float coercion for JSON #[MapRequestPayload] with pre-parsed array data
[Messenger] Flush batch handlers after inactivity timeout when worker is busy
[PhpUnitBridge] fix tests
[TypeInfo] Fix StringTypeResolver calling Type::enum() on interfaces extending BackedEnum
[FrameworkBundle] Remove dead code related to removed XML configuration
[Mailer] [Mailjet] Fix inline attachments with custom Content-ID.
[RateLimiter] Ensure hit count is always positive
* 6.4:
[HttpKernel] Fix int-to-float coercion for JSON #[MapRequestPayload] with pre-parsed array data
[Messenger] Flush batch handlers after inactivity timeout when worker is busy
[PhpUnitBridge] fix tests
[Mailer] [Mailjet] Fix inline attachments with custom Content-ID.
[RateLimiter] Ensure hit count is always positive
* 8.0: (26 commits)
Fix merge
[RateLimiter] Fix retryAfter when consuming exactly all remaining tokens in FixedWindow and TokenBucket
[RateLimiter] Fix retryAfter value on last token consume (SlidingWindow)
[RateLimiter] Fix reservations outside the second fixed window
[Filesystem] makePathRelative with existing files, remove ending /
[Config][Routing] Fix exclude option being ignored for non-glob and PSR-4 resources
[Serializer][Validator] Fix propertyPath in ConstraintViolationListNormalizer with MetadataAwareNameConverter
[Messenger][Amqp] Don't use retry routing key when sending to failure transport
[Messenger] Fix re-sending failed messages to a different failure transport
[DependencyInjection] Fix #[AsTaggedItem] discovery through multi-level decoration chains
[Config] Fix ArrayShapeGenerator required keys with deep merging
[Validator] Add a guard when `Parser::IGNORE_UNKNOWN_VARIABLES` is not defined
[Validator] Correctly handle null `allowedVariables` in `ExpressionSyntaxValidator`
[DependencyInjection] Fix PriorityTaggedServiceTrait not discovering #[AsTaggedItem] on decorated services
[Mailer] Clarify the purpose of SentMessage's "message id" concept
[ObjectMapper] fix nested mapping with class-level transform
[TwigBridge] Fix Bootstrap 4 form error layout
[Form] Fix merging POST params and files when collection entries have mismatched indices
[Validator] Fix type error for non-array items when Unique::fields is set
[HttpKernel] Fix default locale ignored when Accept-Language has no enabled-locale match
...
* 7.4: (25 commits)
[RateLimiter] Fix retryAfter when consuming exactly all remaining tokens in FixedWindow and TokenBucket
[RateLimiter] Fix retryAfter value on last token consume (SlidingWindow)
[RateLimiter] Fix reservations outside the second fixed window
[Filesystem] makePathRelative with existing files, remove ending /
[Config][Routing] Fix exclude option being ignored for non-glob and PSR-4 resources
[Serializer][Validator] Fix propertyPath in ConstraintViolationListNormalizer with MetadataAwareNameConverter
[Messenger][Amqp] Don't use retry routing key when sending to failure transport
[Messenger] Fix re-sending failed messages to a different failure transport
[DependencyInjection] Fix #[AsTaggedItem] discovery through multi-level decoration chains
[Config] Fix ArrayShapeGenerator required keys with deep merging
[Validator] Add a guard when `Parser::IGNORE_UNKNOWN_VARIABLES` is not defined
[Validator] Correctly handle null `allowedVariables` in `ExpressionSyntaxValidator`
[DependencyInjection] Fix PriorityTaggedServiceTrait not discovering #[AsTaggedItem] on decorated services
[Mailer] Clarify the purpose of SentMessage's "message id" concept
[ObjectMapper] fix nested mapping with class-level transform
[TwigBridge] Fix Bootstrap 4 form error layout
[Form] Fix merging POST params and files when collection entries have mismatched indices
[Validator] Fix type error for non-array items when Unique::fields is set
[HttpKernel] Fix default locale ignored when Accept-Language has no enabled-locale match
[FrameworkBundle] Make `ConfigDebugCommand` use its container to resolve env vars
...
* 6.4:
[RateLimiter] Fix retryAfter when consuming exactly all remaining tokens in FixedWindow and TokenBucket
[RateLimiter] Fix retryAfter value on last token consume (SlidingWindow)
[RateLimiter] Fix reservations outside the second fixed window
[Filesystem] makePathRelative with existing files, remove ending /
[Config][Routing] Fix exclude option being ignored for non-glob and PSR-4 resources
[Serializer][Validator] Fix propertyPath in ConstraintViolationListNormalizer with MetadataAwareNameConverter
[Messenger][Amqp] Don't use retry routing key when sending to failure transport
[Messenger] Fix re-sending failed messages to a different failure transport
[DependencyInjection] Fix #[AsTaggedItem] discovery through multi-level decoration chains
[DependencyInjection] Fix PriorityTaggedServiceTrait not discovering #[AsTaggedItem] on decorated services
[Mailer] Clarify the purpose of SentMessage's "message id" concept
[TwigBridge] Fix Bootstrap 4 form error layout
[Form] Fix merging POST params and files when collection entries have mismatched indices
[Validator] Fix type error for non-array items when Unique::fields is set
[HttpKernel] Fix default locale ignored when Accept-Language has no enabled-locale match
[FrameworkBundle] Make `ConfigDebugCommand` use its container to resolve env vars
[Console] Fix various completion edge cases
[Messenger][AmazonSqs] Add test for default queue_name when not set in DSN path or options
This PR was merged into the 8.1 branch.
Discussion
----------
[Messenger] Route decode failures through failure handling
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Fix#44117, also related to #39622
| License | MIT
Previously, when a transport could not decode a message, `MessageDecodingFailedException` was thrown inside receivers' `get()`, causing the message to be deleted from the queue with no retry or DLQ routing.
This PR routes decode failures through the normal failure-handling path instead of silently losing messages.
This changes a bit the contracts of serializers: they should now return `Envelope<MessageDecodingFailedException>` on decode failure, wrapping the raw encoded envelope. Throwing is still supported for BC with custom serializers - receivers catch and wrap it as a fallback.
A new `DecodeFailedMessageMiddleware` sits early in the default middleware stack (before `failed_message_processing_middleware`). When it encounters an envelope whose message is a `MessageDecodingFailedException`, it:
1. Determines the original transport name to look up the correct serializer.
2. Re-decodes the raw payload; if decoding still fails, the `MessageDecodingFailedException` is thrown so that standard retry/DLQ handling kicks in.
3. If decoding succeeds (e.g. after a deployment that adds the missing class), merges all stamps from the wrapping envelope onto the freshly decoded one and continues through the stack normally.
Receivers no longer delete-then-throw. Instead they yield the wrapped envelope with the same stamps as a successful decode, so `ack()`/`reject()` work correctly downstream. The old catch-and-throw path is kept only as a BC fallback for custom serializers that still throw.
A message that cannot be decoded is therefore no longer lost. It travels through the bus as a `MessageDecodingFailedException`, hits the failure/retry infrastructure like any other failed message, and is automatically retried (triggering `DecodeFailedMessageMiddleware` again) once the serializer or class definition is fixed.
Commits
-------
37c7e90ee72 [Messenger] Route decode failures through failure handling
* 8.0:
[Serializer] Fix handling of constructor enum denormalization errors
[Console] ProgressIndicator console helper display with multiple processes
[HttpFoundation] Handle empty session data in updateTimestamp() to fix compat with PHP 8.6
[Console] Fix arguments set via #[Ask] wrongly considered null in profiler
[Cache] Wrap `DoctrineDbalAdapter::doSave()` in savepoint to prevent transaction poisoning
Update security-1.0.xsd with missing oauth2 element
[Console] Silence shell_exec warning in hasSttyAvailable
[Validator] Sync validators.pt.xlf
Minor: Review and finalize Latvian translations for validators
streamline ini settings in phpunit.xml.dist files
stop using with*() without expects()
stop using with*() without expects()
TypeContextFactory::collectTemplates now also works with @phpstan-template and @psalm-template
* 7.4:
[Validator] Sync validators.pt.xlf
Minor: Review and finalize Latvian translations for validators
streamline ini settings in phpunit.xml.dist files
stop using with*() without expects()
stop using with*() without expects()
TypeContextFactory::collectTemplates now also works with @phpstan-template and @psalm-template
* 8.0:
[Console] Fix ProgressBar %remaining% and %estimated% placeholder guards
[Validator] Fix missing null type in ValidatorInterface::validate() phpdoc
use PHPUnit 13 on PHP 8.4+
[PropertyInfo] Prioritize property type over is/has/can accessors
* 7.4:
[Console] Fix ProgressBar %remaining% and %estimated% placeholder guards
[Validator] Fix missing null type in ValidatorInterface::validate() phpdoc
use PHPUnit 13 on PHP 8.4+
[PropertyInfo] Prioritize property type over is/has/can accessors
* 8.0:
[Messenger] Fix merge
[Workflow] Fix swapped workflow/transition names in WorkflowValidator
fix merge
[DependencyInjection] Fix stale binding lookup in ResolveBindingsPass error message
fix: correct romanian translations and add missing paucal forms
[Cache] Fix DSN auth not passed to Redis/RedisCluster/Relay in RedisTrait
[Cache] Fix DSN auth not passed to Redis/RedisCluster/Relay in RedisTrait
skip a test case that doesn't work with PCRE < 10.40
sync ICU stub version
do not use PHPUnit mock objects without configured expectations
[WebProfilerBundle] Fix EventSource is missing static properties
[FrameworkBundle] express that raw strings are mapped to senders for messenger routing
[Asset] Fix JsonManifestVersionStrategy exception on missing manifest in non-strict mode
[Yaml] Fix parsing nested mappings in sequences
* 7.4:
[Messenger] Fix merge
[Workflow] Fix swapped workflow/transition names in WorkflowValidator
fix merge
[DependencyInjection] Fix stale binding lookup in ResolveBindingsPass error message
fix: correct romanian translations and add missing paucal forms
[Cache] Fix DSN auth not passed to Redis/RedisCluster/Relay in RedisTrait
[Cache] Fix DSN auth not passed to Redis/RedisCluster/Relay in RedisTrait
skip a test case that doesn't work with PCRE < 10.40
sync ICU stub version
do not use PHPUnit mock objects without configured expectations
[WebProfilerBundle] Fix EventSource is missing static properties
[FrameworkBundle] express that raw strings are mapped to senders for messenger routing
[Asset] Fix JsonManifestVersionStrategy exception on missing manifest in non-strict mode
[Yaml] Fix parsing nested mappings in sequences
* 8.0:
[JsonStreamer] Fix DateTime handling in union types
Revert "bug #62852 [Cache] Fix DSN auth not passed to clusters in RedisTrait (wikando-ck)"
[Messenger][Cache] Fix forwarding SSL settings to the redis sentinel
[FrameworkBundle] Fix autoconfiguring controllers using legacy Route annotations as attributes
fix compatibility with PCRE < 10.40
fix forward compatibility with JsonStreamer 8.1+
[Intl] Update data to ICU 78.2
[Messenger] Fix AMQP heartbeat reconnection during in-flight message handling
[JsonStreamer] Fix composite node provider arguments in stream mode
[PropertyInfo] Fix union with mixed handling
[Messenger] Optimize serialized size of ErrorDetailsStamp
fix compatibility with DBAL 4.4+
* 7.4:
[JsonStreamer] Fix DateTime handling in union types
Revert "bug #62852 [Cache] Fix DSN auth not passed to clusters in RedisTrait (wikando-ck)"
[Messenger][Cache] Fix forwarding SSL settings to the redis sentinel
[FrameworkBundle] Fix autoconfiguring controllers using legacy Route annotations as attributes
fix compatibility with PCRE < 10.40
fix forward compatibility with JsonStreamer 8.1+
[Intl] Update data to ICU 78.2
[Messenger] Fix AMQP heartbeat reconnection during in-flight message handling
[JsonStreamer] Fix composite node provider arguments in stream mode
[PropertyInfo] Fix union with mixed handling
[Messenger] Optimize serialized size of ErrorDetailsStamp
fix compatibility with DBAL 4.4+
This PR was merged into the 8.1 branch.
Discussion
----------
[Messenger] Add idle timeout option to `BatchHandlerTrait`
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | maybe?
| New feature? | yes
| Deprecations? | no
| Issues | Fix#63205
| License | MIT
This PR adds a `getIdleTimeout()` method to `BatchHandlerTrait`, allowing batches to be flushed after a configured idle time when the required batch size is not reached.
This ensures that low-throughput workloads are processed regardless of batch size, rather than waiting indefinitely for the batch to fill up.
For older Symfony versions, users can copy this updated `BatchHandlerTrait` implementation and use it directly in their projects.
Commits
-------
93ae755cd84 [Messenger] Add idle timeout option to `BatchHandlerTrait`
* 8.0: (21 commits)
[WebProfilerBundle] Fix hot reload support (FrankenPHP)
[Serializer] Normalize static methods when they have groups
[PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x
[DoctrineBridge] Respect schema_filter in schema listeners
[HttpClient] Fix destructor throwing while timeout was handled
[HttpClient] Test throwing destructor together with retryable
[Mime] Update mime types
[HttpFoundation] Reject invalid paths
[HttpKernel] Fix handling empty MapUploadedFile arrays
[FrameworkBundle] Add missing `useAttributeAsKey` calls
[Di] Fix invalid reference behavior
When calling UploadedFile::getErrorMessage() to a file which has no error and is uploaded successfully, it should not return an error
[HttpKernel] Bypass mapping construction when `RedirectController::urlRedirectAction` is triggered
cs fix
[Console] fall back to 0 when getCode() does not provide an integer
fix merge
[FrameworkBundle] Fix accessing the test container when using KernelTestCase in non-debug mode
Fix running HttpClient tests
[FrameworkBundle] Fix clearing the HttpCache store in tests
[DependencyInjection][HttpKernel] Fix parsing Target attributes on properties and on controllers
...
* 7.4: (21 commits)
[WebProfilerBundle] Fix hot reload support (FrankenPHP)
[Serializer] Normalize static methods when they have groups
[PropertyInfo] fix compatibility with phpdocumentor/reflection-docblock 6.x
[DoctrineBridge] Respect schema_filter in schema listeners
[HttpClient] Fix destructor throwing while timeout was handled
[HttpClient] Test throwing destructor together with retryable
[Mime] Update mime types
[HttpFoundation] Reject invalid paths
[HttpKernel] Fix handling empty MapUploadedFile arrays
[FrameworkBundle] Add missing `useAttributeAsKey` calls
[Di] Fix invalid reference behavior
When calling UploadedFile::getErrorMessage() to a file which has no error and is uploaded successfully, it should not return an error
[HttpKernel] Bypass mapping construction when `RedirectController::urlRedirectAction` is triggered
cs fix
[Console] fall back to 0 when getCode() does not provide an integer
fix merge
[FrameworkBundle] Fix accessing the test container when using KernelTestCase in non-debug mode
Fix running HttpClient tests
[FrameworkBundle] Fix clearing the HttpCache store in tests
[DependencyInjection][HttpKernel] Fix parsing Target attributes on properties and on controllers
...
* 6.4:
[WebProfilerBundle] Fix hot reload support (FrankenPHP)
[Serializer] Normalize static methods when they have groups
[DoctrineBridge] Respect schema_filter in schema listeners
[HttpClient] Fix destructor throwing while timeout was handled
[HttpClient] Test throwing destructor together with retryable
[Mime] Update mime types
[HttpFoundation] Reject invalid paths
[FrameworkBundle] Add missing `useAttributeAsKey` calls
[Di] Fix invalid reference behavior
When calling UploadedFile::getErrorMessage() to a file which has no error and is uploaded successfully, it should not return an error
cs fix
[Console] fall back to 0 when getCode() does not provide an integer
[FrameworkBundle] Fix accessing the test container when using KernelTestCase in non-debug mode
[Messenger] Avoid skipping batch handlers on flush
This PR was merged into the 8.1 branch.
Discussion
----------
[Messenger] Add regex support for transport name matching in `messenger:consume` command
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Fix#61259
| License | MIT
### Overview:
This PR adds support for regex patterns in the `messenger:consume` command, allowing devs to match transport names dynamically (e.g., scheduler_.*).
### Key Changes:
* Introduced regex matching for transport names.
### Example Usage:
* `php bin/console messenger:consume '(?i)THIRD.*' second.*` – Match multiple transports using regex patterns.
* `php bin/console messenger:consume second.*` – Match transports starting with second.
* `php bin/console messenger:consume one.* normal` – Match using both a regex (one.*) and a specific name (normal).
### Note:
This feature does not work when the `messenger:consume` command is run in interactive mode.
Commits
-------
4e534339627 [Messenger] Add regex support for transport name matching in `messenger:consume` command
This PR was merged into the 6.4 branch.
Discussion
----------
[Messenger] Avoid skipping batch handlers on flush
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | Fix#59958
| License | MIT
When using multiple Batch handlers, the situation can occur that there are multiple batch handlers that have messages that aren't processed and therefor not acked yet. The issue is caused by a optimalization that unsets the current batch handler in a foreach loop.
"The acknowledger was not called by the ... batch handler." is thrown when a worker is stopped and the batch isn't handled.
The issue is reproducable and testable with the attached unit test.
Commits
-------
76588d0d68d [Messenger] Avoid skipping batch handlers on flush
This PR was squashed before being merged into the 8.1 branch.
Discussion
----------
PHP CS Fixer: enable ``@PHP8x1Migration`:risky`
| Q | A
| ------------- | ---
| Branch? | 8.1
| Bug fix? | no
| New feature? | no <!-- if yes, also update src/**/CHANGELOG.md -->
| Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md -->
| Issues | Fix CS <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below -->
| License | MIT
Commits
-------
3373aa5aa76 PHP CS Fixer: enable ``@PHP8x1Migration`:risky`