forked from symfony/symfony
-
Notifications
You must be signed in to change notification settings - Fork 0
fix/resolve event listener #5
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…icolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Fix storing binary keys when using pgsql | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#49748 | License | MIT | Doc PR | - Commits ------- be88fd0 [Cache] Fix storing binary keys when using pgsql
…ssignment operator (weaverryan) This PR was merged into the 5.4 branch. Discussion ---------- [Cache] Fix php7 compat on 5.4: null coalescing assignment operator | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | None | License | MIT | Doc PR | Not needed It looks like symfony#49848 accidentally introduced a syntax not compat with php 7.2/7.3. So, an annoying little PR to fix that. Commits ------- 7e5fe59 [Cache] Removing null coalescing assignment operator on 5.4
… catalogue domains instead of operation domains (welcoMattic) This PR was merged into the 5.4 branch. Discussion ---------- [Translation] TranslatorBag::diff now iterates over catalogue domains instead of operation domains | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix symfony#47886 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | For Loco Provider (at least, but I'm pretty sure it applies for Lokalise and Crowdin), the `--force` option on `translation:push` command has no effect. The main cause is located in the `TranslatorBag::diff` method which was iterating over `$operation->getDomains()` to add new messages to the diff catalogue. But, the fact is `$operation->getDomains()` returns all domains *AND* their `+intl-icu` variants! Which is certainly not what we want here. See the test that covers the case ```php public function testDiffWithIntlDomain() { $catalogueA = new MessageCatalogue('en', [ 'domain1+intl-icu' => ['foo' => 'foo', 'bar' => 'bar'], 'domain2' => ['baz' => 'baz', 'qux' => 'qux'], ]); $bagA = new TranslatorBag(); $bagA->addCatalogue($catalogueA); $catalogueB = new MessageCatalogue('en', [ 'domain1' => ['foo' => 'foo'], 'domain2' => ['baz' => 'baz', 'corge' => 'corge'], ]); $bagB = new TranslatorBag(); $bagB->addCatalogue($catalogueB); $bagResult = $bagA->diff($bagB); $this->assertEquals([ 'en' => [ 'domain1' => ['bar' => 'bar'], 'domain2' => ['qux' => 'qux'], ], ], $this->getAllMessagesFromTranslatorBag($bagResult)); } ``` Without the change, `'foo' => 'foo'` was in the result bag. Replaces symfony#47986 Commits ------- 178abbf TranslatorBag::diff now iterates over catalogue domains instead of operation domains
…ck when canceling a MockResponse (fancyweb) This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix not calling the on progress callback when canceling a MockResponse | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - I want to assert that a response is canceled under certain circumstances. My first approach was to get the info from the MockResponse I pass as the response factory to the MockHttpClient but this one is lost since a new instance is created when the request method is called. My next approach was to wrap the MockHttpClient I pass to the class I'm testing with a TraceableHttpClient. But it doesn't work because the traced info is outdated. The problem seems to be that the on-progress callback is not called when a MockResponse is canceled. Commits ------- a27bd88 [HttpClient] Fix not calling the on progress callback when canceling a MockResponse
…tion is disabled (bastnic) This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] enable metadata cache when annotation is disabled | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> When using Annotations, annotations are cached at `AnnotationLoader` level. Which is cleared when entities are changed. So the dev experience is optimal. ``` [ClassMetadataFactory.php](vendor/symfony/serializer/Mapping/Factory/ClassMetadataFactory.php") on line 51: [Symfony\Component\Serializer\Mapping\Loader\LoaderChain](vendor/symfony/serializer/Mapping/Loader/LoaderChain.php&line=28#line28) {symfony#543 ▼ -loaders: array:1 [▼ 0 => [Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader](vendor/symfony/serializer/Mapping/Loader/AnnotationLoader.php&line=33#line33) {symfony#544 ▼ -reader: [Doctrine\Common\Annotations\PsrCachedReader](vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/PsrCachedReader.php&line=22#line22) {symfony#262 ▼ -delegate: [Doctrine\Common\Annotations\AnnotationReader](vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php&line=20#line20) {symfony#263 ▶} -cache: [Symfony\Component\Cache\Adapter\PhpArrayAdapter](vendor/symfony/cache/Adapter/PhpArrayAdapter.php&line=32#line32) {symfony#277 ▶} -debug: true -loadedAnnotations: array:14 [▶] -loadedFilemtimes: array:4 [▶] } } ] } ``` When using yaml files, there is no cache at the loader level so I added in the past the same cache as for the prod env, as the metadata are effectively cleared when using only yaml config files. symfony#35109 The regression introduced by my patch is for people that do not use mapping files but use annotations. symfony#41961 But now, we are in the opposite situation: no cache for people using mapping files but not annotations. On a current project it means loading 83 yaml files for each dev requests. It's not good at all. A simple local fix is to add that in a dev services files. ```yaml serializer.mapping.cache_class_metadata_factory: class: 'Symfony\Component\Serializer\Mapping\Factory\CacheClassMetadataFactory' decorates: 'serializer.mapping.class_metadata_factory' arguments: ['`@serializer`.mapping.cache_class_metadata_factory.inner', '`@serializer`.mapping.cache.symfony'] ```  A solution in Symfony could be: 1/ only yaml/xml mapping files (`enable_annotations: false`) : cache like prod => that what I did in this PR, as it fixes the current perf regressions on my different projects. There is no cache on yaml/xml file as soon as annotation is enabled (which is the default) 2/ add a cache at reader level for yaml/xml loader 3/ add a cache cleaner at metadata level when annotation are enabled Commits ------- 1773dff [FrameworkBundle] enable metadata cache when annotation is disabled
…fication emails (1ed) This PR was merged into the 5.4 branch. Discussion ---------- [TwigBridge] Fix raw content rendering in HTML notification emails | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | Applying nl2br on raw HTML seems wrong to me and it also makes raw ineffective. Commits ------- f301f1d [TwigBridge] Fix raw content rendering in HTML notification emails
…variadic parameters (melya) This PR was submitted for the 6.2 branch but it was squashed and merged into the 5.4 branch instead. Discussion ---------- [Serializer] Preserve array keys while denormalize variadic parameters | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#49616 | License | MIT | Doc PR | Let me know if needed | PHP | 8.1.15 Hi Symfony folks! I've struggled with denormalization issue. It appears when serialize an object with variadic parameter from associative array. Currently, after denormalization array keys get reset and it is not compatible with previous version of object. Example: ```php <?php declare(strict_types=1); use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Normalizer\PropertyNormalizer; use Symfony\Component\Serializer\Serializer; require_once __DIR__ . "/vendor/autoload.php"; final class Dummy { public function __construct(public readonly string $i) { } } final class DummyWithVariadic { public $dummies; public function __construct(Dummy ...$dummies) { $this->dummies = $dummies; } } $serializer = new Serializer([$normalizer = new PropertyNormalizer()], [new JsonEncoder()]); $normalizer->setSerializer($serializer); $dummies = ["d1" => new Dummy("d1 value"), "d2" => new Dummy("d2 value")]; $object = new DummyWithVariadic(...$dummies); var_dump($object); /* Output: class DummyWithVariadic#310 (1) { public $dummies => array(2) { 'd1' => class Dummy#308 (1) { public readonly string $i => string(8) "d1 value" } 'd2' => class Dummy#309 (1) { public readonly string $i => string(8) "d2 value" } } } */ $json = $serializer->serialize($object, "json"); echo $json . PHP_EOL; /* Output: {"dummies":{"d1":{"i":"d1 value"},"d2":{"i":"d2 value"}}} */ $deserialized = $serializer->deserialize($json, DummyWithVariadic::class, "json"); var_dump($deserialized); /* Output: class DummyWithVariadic#315 (1) { public $dummies => array(2) { [0] => class Dummy#319 (1) { public readonly string $i => string(8) "d1 value" } [1] => class Dummy#320 (1) { public readonly string $i => string(8) "d2 value" } } } */ $jsonFromDeserialized = $serializer->serialize($deserialized, "json"); echo $jsonFromDeserialized . PHP_EOL; /* Output: {"dummies":[{"i":"d1 value"},{"i":"d2 value"}]} */ var_dump($json === $jsonFromDeserialized); // And now the deserialization result without respected array keys :( /* Output: bool(false) */ ``` Let me know if we can add this fix for earlier versions 🙌 > Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). I hope it's not , feedback is appreciated! > Never break backward compatibility (see https://symfony.com/bc) Commits ------- c1f844a [Serializer] Preserve array keys while denormalize variadic parameters
released v5.4.22
This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix canceling MockResponse | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | - | Tickets | symfony#49925 | License | MIT | Doc PR | - MockResponse not issued by MockHttpClient might not have the http_method info set. http_code looks safe since it's defined in the constructor. Commits ------- f9abba7 [HttpClient] Fix canceling MockResponse
…vents (dmaicher) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [DoctrineBridge] fix issue with missing stopwatch events | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix doctrine/DoctrineBundle#1622 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> This fixes doctrine/DoctrineBundle#1622 We were not triggering the stopwatch events/sections properly when using prepared statements. Now it works:   Commits ------- 52f4f7b [DoctrineBridge] fix issue with missing stopwatch events
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- Fix intl data tests | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a The migration to static data providers in tests missed a broken method call because the CI did not run the intl-data tests when modifying those tests outside of a PR updating the data (I caught this when my PR moving the emoji data to a different location triggered this workflow). Commits ------- 7ddec68 Fix intl data tests
…adme (alamirault) This PR was merged into the 5.4 branch. Discussion ---------- [Notifier] Document Firebase options object in readme | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Notifier bridges documentation is now in readme. This PR add missing documentation for Firebase Options. (Initially working on symfony/symfony-docs#14950) Commits ------- a116859 [Notifier] Document Firebase options object in readme
…ethods (VincentLanglet) This PR was merged into the 5.4 branch. Discussion ---------- [DomCrawler] Avoid passing null to substr/strrpos methods | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix symfony#49960 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> When calling `resolve('foo', 'http://localhost?bar=1')` two php deprecations were triggered. This is because `parse_url` returns null and then we use the result as a string. I made the code working the same for `resolve('foo', 'http://localhost?bar=1')` than for `resolve('/foo', 'http://localhost?bar=1')` (which was already tested and was not triggering the deprecation). Commits ------- a025ee1 Avoid call on null
…alizerErrorRenderer` (nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [ErrorHandler] Fix sending `Vary` header with `SerializerErrorRenderer` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This mistake is way too easy to make :) Commits ------- 0c0d852 [ErrorHandler] Fix sending Vary header with SerializerErrorRenderer
…ezone is false (bogdanmoza) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [VarDumper] Dumping DateTime throws error if getTimezone is false | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | ---- **TL;DR:** In case you have a DateTime object that returns false when calling `getTimezone()`, an error is thrown in DateCaster. **Description** So I have encountered this case when I have tried to dump a mocked DateTime object. The mock will not have a timezone making the `getTimezone()` method return false. I know that this is not really a bug, as a DateTime object not having a DateTimeZone should not be happening, but it is possible in case someone extends the DateTime object and overrides the `getTimezone()` method. The error thrown is 'The DatetimeInterface object has not been correctly initialized by its constructor' **How to reproduce** ``` class A extends \DateTime { public function getTimezone(): \DateTimeZone|false { return false; } } ``` Dump the A class will cause an error. **Final notes** Even though this a special case, I still think that you should be able to dump a mocked DateTime. I hope the description and everything is ok as this is my first pr here. Cheers! Commits ------- d6bc7a4 [VarDumper] Dumping DateTime throws error if getTimezone is false
…ut command (ro0NL) This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Ignore missing directories in about command | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes IMHO | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> This fixes our CI when `var/log` is missing. Before: ``` In AboutCommand.php line 105: [UnexpectedValueException] RecursiveDirectoryIterator::__construct(/app/var/log): Failed to open directory: No such file or directory ``` After: ``` Cache directory ./var/cache/prod (939 KiB) Build directory ./var/cache/prod (939 KiB) Log directory ./var/log (n/a) ``` Commits ------- 6dacc59 [FrameworkBundle] Ignore missing directories in about command
…trategy for re-delivery" (bendavies) This PR was merged into the 5.4 branch. Discussion ---------- Revert "Respect isRetryable decision of the retry strategy for re-delivery" | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Reverts symfony#49063 | License | MIT | Doc PR | Revert "[Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered" This reverts symfony#49063 The linked PR rendered `RecoverableExceptionInterface` useless - i.e. it would not retry indefinately as stated in the docs. See the [discussion on the original PR](symfony#49063 (comment)) Commits ------- dd328a2 Revert "[Messenger] Respect `isRetryable` decision of the retry strategy when deciding if failed message should be re-delivered"
…strings (Daniel Kozák) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [HttpClient] Fix encoding some characters in query strings | Q | A | ------------- | --- | Branch? | 5.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix symfony#50670 <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Commits ------- cb26c19 [HttpClient] Fix encoding some characters in query strings
… Polish language (stloyd) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Validator] Add missing validator translations in Polish language | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | n/a <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the latest branch. - For new features, provide some code snippets to help understand usage. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> Similar to symfony#50590 but now in Polish language Commits ------- eb08ef3 [Validator] Add missing validator translations in Polish language
…colas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] Preserve existing Doctrine schema | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no (fixing a not released bug) | New feature? | no | Deprecations? | no | Tickets | Fix symfony#50717 | License | MIT | Doc PR | - [Inlining](https://github.com/symfony/symfony/pull/50742/files#diff-2a38c9deb498eec50126c297bb3d094c8efb29364934e902d6481761ace6f20a) since Doctrine deprecated "toSaveSql" without providing an alternative. Cleaning up a few unneeded calls to `ORMSetup::createConfiguration()` also. Commits ------- 96c227a [Messenger] Preserve existing Doctrine schema
…nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [HttpClient] Explicitly exclude CURLOPT_POSTREDIR | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | symfony#50520 | License | MIT | Doc PR | - Commits ------- c90e20f [HttpClient] Explicitly exclude CURLOPT_POSTREDIR
…-referenced as runtime exceptions (nicolas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] Skip errored definitions deep-referenced as runtime exceptions | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#50708 | License | MIT | Doc PR | - This solves the linked issue by not throwing a compile-time error when the service graph looks like this (when ServiceC has errors): ``` ServiceA ---(runtime-exception-on-invalid-ref)---> ServiceB ---(exception-on-invalid-ref)---> ServiceC ``` Commits ------- fef31dc [DependencyInjection] Skip errored definitions deep-referenced as runtime exceptions
released v5.4.25
838a2fc
to
1339e8d
Compare
1339e8d
to
20ae84e
Compare
nikophil
pushed a commit
that referenced
this pull request
Jan 31, 2024
…read from socket (xdanik) This PR was merged into the 5.4 branch. Discussion ---------- [Mailer] Throw `TransportException` when unable to read from socket | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? |no | Issues | None | License | MIT We are seeing error `fgets(): SSL: Connection reset by peer` multiple times a day from connection to Office 365 SMTP server (smtp.office365.com:587). It's certainly related to some kind of timeout as we are sending emails from long running queue dispatcher and error shows up only occasionally and never with the first message. We are not seeing this issue with any other SMTP server, but we have not tested much past smtp.mandrillapp.com and local MailHog. We have tried adjusting the `$pingThreshold` and `$restartThreshold` options, but without much success (well `$restartThreshold = 1` resolves the issue, but it also forces the transport to close connection after each message). Stack trace: ``` #0 /var/www/vendor/symfony/mailer/Transport/Smtp/Stream/AbstractStream.php(77): fgets(Resource(stream)) #1 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(315): Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream->readLine() #2 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(181): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->getFullResponse() #3 /var/www/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(140): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->executeCommand("RSET ", Array(1)) #4 /var/www/vendor/symfony/mailer/Mailer.php(45): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(Symfony\Component\Mime\Email), Null) #5 (our queue dispatcher): Symfony\Component\Mailer\Mailer->send(Object(Symfony\Component\Mime\Email)) ``` App is running on PHP 8.0.28 on Debian Linux x64, Mailer v5.4.22. I would gladly written some tests for this, but I don't know how to simulate calls to low-level stream functions like fgets. Commits ------- 44d5b57 [Mailer] Throw TransportException when unable to read from socket
nikophil
pushed a commit
that referenced
this pull request
May 6, 2024
…hen publishing a message. (jwage) This PR was squashed before being merged into the 6.4 branch. Discussion ---------- [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message. | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony#36538 Fix symfony#48241 | License | MIT If you have a message handler that dispatches messages to another queue, you can encounter `AMQPConnectionException` with the message "Library error: a SSL error occurred" or "a socket error occurred" depending on if you are using tls or not or if you are running behind a load balancer or not. You can manually reproduce this issue by dispatching a message where the handler then dispatches another message to a different queue, then go to rabbitmq admin and close the connection manually, then dispatch another message and when the message handler goes to dispatch the other message, you will get this exception: ``` a socket error occurred #0 /vagrant/vendor/symfony/amqp-messenger/Transport/AmqpTransport.php(60): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender->send() #1 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(62): Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpTransport->send() #2 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle() #3 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(61): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle() #4 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle() #5 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle() symfony#6 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle() symfony#7 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle() symfony#8 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch() symfony#9 /vagrant/src/Messenger/MessageBus.php(37): Symfony\Component\Messenger\TraceableMessageBus->dispatch() symfony#10 /vagrant/vendor/symfony/mailer/Mailer.php(66): App\Messenger\MessageBus->dispatch() symfony#11 /vagrant/src/Mailer/Mailer.php(83): Symfony\Component\Mailer\Mailer->send() symfony#12 /vagrant/src/Mailer/Mailer.php(96): App\Mailer\Mailer->send() symfony#13 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(118): App\Mailer\Mailer->sendEmail() symfony#14 /vagrant/src/MessageHandler/Trading/StrategySubscriptionMessageHandler.php(72): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->handle() symfony#15 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(152): App\MessageHandler\Trading\StrategySubscriptionMessageHandler->__invoke() symfony#16 /vagrant/vendor/symfony/messenger/Middleware/HandleMessageMiddleware.php(91): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->callHandler() symfony#17 /vagrant/vendor/symfony/messenger/Middleware/SendMessageMiddleware.php(71): Symfony\Component\Messenger\Middleware\HandleMessageMiddleware->handle() symfony#18 /vagrant/vendor/symfony/messenger/Middleware/FailedMessageProcessingMiddleware.php(34): Symfony\Component\Messenger\Middleware\SendMessageMiddleware->handle() symfony#19 /vagrant/vendor/symfony/messenger/Middleware/DispatchAfterCurrentBusMiddleware.php(68): Symfony\Component\Messenger\Middleware\FailedMessageProcessingMiddleware->handle() symfony#20 /vagrant/vendor/symfony/messenger/Middleware/RejectRedeliveredMessageMiddleware.php(41): Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware->handle() symfony#21 /vagrant/vendor/symfony/messenger/Middleware/AddBusNameStampMiddleware.php(37): Symfony\Component\Messenger\Middleware\RejectRedeliveredMessageMiddleware->handle() symfony#22 /vagrant/vendor/symfony/messenger/Middleware/TraceableMiddleware.php(40): Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware->handle() symfony#23 /vagrant/vendor/symfony/messenger/MessageBus.php(70): Symfony\Component\Messenger\Middleware\TraceableMiddleware->handle() symfony#24 /vagrant/vendor/symfony/messenger/TraceableMessageBus.php(38): Symfony\Component\Messenger\MessageBus->dispatch() symfony#25 /vagrant/vendor/symfony/messenger/RoutableMessageBus.php(54): Symfony\Component\Messenger\TraceableMessageBus->dispatch() symfony#26 /vagrant/vendor/symfony/messenger/Worker.php(162): Symfony\Component\Messenger\RoutableMessageBus->dispatch() symfony#27 /vagrant/vendor/symfony/messenger/Worker.php(109): Symfony\Component\Messenger\Worker->handleMessage() symfony#28 /vagrant/vendor/symfony/messenger/Command/ConsumeMessagesCommand.php(238): Symfony\Component\Messenger\Worker->run() symfony#29 /vagrant/vendor/symfony/console/Command/Command.php(326): Symfony\Component\Messenger\Command\ConsumeMessagesCommand->execute() symfony#30 /vagrant/vendor/symfony/console/Application.php(1096): Symfony\Component\Console\Command\Command->run() symfony#31 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(126): Symfony\Component\Console\Application->doRunCommand() symfony#32 /vagrant/vendor/symfony/console/Application.php(324): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() symfony#33 /vagrant/vendor/symfony/framework-bundle/Console/Application.php(80): Symfony\Component\Console\Application->doRun() symfony#34 /vagrant/vendor/symfony/console/Application.php(175): Symfony\Bundle\FrameworkBundle\Console\Application->doRun() symfony#35 /vagrant/vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php(49): Symfony\Component\Console\Application->run() symfony#36 /vagrant/vendor/autoload_runtime.php(29): Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() symfony#37 /vagrant/bin/console(11): require_once('...') symfony#38 {main} ``` TODO: - [x] Add test for retry logic when publishing messages Commits ------- f123370 [Messenger] [Amqp] Handle AMQPConnectionException when publishing a message.
nikophil
pushed a commit
that referenced
this pull request
Aug 29, 2024
…rsimpsons) This PR was merged into the 5.4 branch. Discussion ---------- [Yaml] 🐛 throw ParseException on invalid date | Q | A | ------------- | --- | Branch? | 5.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | None <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT (found in symfony-tools/docs-builder#179) When parsing the following yaml: ``` date: 6418-75-51 ``` `symfony/yaml` will throw an exception: ``` $ php main.php PHP Fatal error: Uncaught Exception: Failed to parse time string (6418-75-51) at position 6 (5): Unexpected character in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php:714 Stack trace: #0 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(714): DateTimeImmutable->__construct() #1 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(312): Symfony\Component\Yaml\Inline::evaluateScalar() #2 /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php(80): Symfony\Component\Yaml\Inline::parseScalar() #3 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(790): Symfony\Component\Yaml\Inline::parse() #4 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(341): Symfony\Component\Yaml\Parser->parseValue() #5 /tmp/symfony-yaml/vendor/symfony/yaml/Parser.php(86): Symfony\Component\Yaml\Parser->doParse() symfony#6 /tmp/symfony-yaml/vendor/symfony/yaml/Yaml.php(77): Symfony\Component\Yaml\Parser->parse() symfony#7 /tmp/symfony-yaml/main.php(8): Symfony\Component\Yaml\Yaml::parse() symfony#8 {main} thrown in /tmp/symfony-yaml/vendor/symfony/yaml/Inline.php on line 714 ``` This is because the "month" is invalid. Fixing the "month" will trigger about the same issue because the "day" would be invalid. With the current change it will throw a `ParseException`. Commits ------- 6d71a7e 🐛 throw ParseException on invalid date
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
isRetryable
decision of the retry strategy when deciding if failed message should be re-deliveredRepeatedType
child inPasswordHasherListener
TestCase
suffix for abstract tests in/Tests/
TestCase
suffix for abstract tests in/Tests/
symfony/symfony#49253 [PHPUnit 10] UseTestCase
suffix for abstract tests in/Tests/
(OskarStark)getNotification
returnsnull
TransportNamesStamp
proxy
tag on original definition when decoratingstatic
data providers usingrector/rector
NoSuspiciousCharacters
constraint to validate a string is not a spoof attemptTransportTestCase
data providers static$this
calls to static ones in data providersBatchHandlerTrait
withgetBatchSize()
static
occurrences that may cause unstable testsstatic
occurrences that may cause unstable tests symfony/symfony#49431 [Mailer][Translation] Remove somestatic
occurrences that may cause unstable tests (alexandre-daubois)static
occurrences that may cause unstable tests symfony/symfony#49431 [Mailer][Translation] Remove somestatic
occurrences that may cause unstable tests (alexandre-daubois)Security::login()
on specific firewallAutowire
attributeskip_response_headers
to theHttpCache
optionsMailjetApiTransport::__toString()
framework.http_cache.skip_response_headers
optioncache:clear
command#[ValueResolver]
and#[AsPinnedValueResolver]
excluded
option to theCascade
constraintsetMethods()
byonlyMethods()
andaddMethods()
#[MapDecorated]
in favor of#[AutowireDecorated]
withConsecutive()
evaluate()
calls inWorkerTest
getSupportedTypes
to allow better performance@required
annotationwithConsecutive()
calls from testswithConsecutive()
calls from testsstrategy
topolicy
in XSDParameterBag::getString()
and deprecate accepting invalid values#[Autowire(lazy: true)]
$exceptionCode
to#[IsGranted]
timeout
andmax_duration
optionsdebug:scheduler
commandPasswordStrength
constraint#[Autowire(lazy: class-string)]
constructor
option to services declaration and to#[Autoconfigure]
debug:schedule
refinementsfindTaggedServiceIds()
static
uses when classes are finalProblemNormalizer
give details aboutValidationFailedException
andPartialDenormalizationException
submitForm()
can't find the formAppVariable
#[MapRequestPayload]
and#[MapQueryString]
to map Request input to typed objects#[MapQueryParameter]
attributeConstraintValidator::formatValue
<bind>
UserPassword
constraintRequest::getPayload()
name
attribute when it does not define their nameSchedulerTest
TriggerInterface
extend\Stringable
MessageContext
MapRequest*
attributes_stateless
attribute to inline rendered fragmentsSfjs
as it is unused and conflicts with WebProfilerBundle’signoreUndefined()
method to allow skip not interesting optionssymfony/twig-bridge
8000 dependencyIS_REPEATABLE
flag toAsMessageHandler
attributeJitterTrigger
crypto_method
to set the minimum TLS version and make it default to v1.2createTabs
from WebProfilerBundleRecurringMessage::getId()
and prevent duplicatescache:clear
commandPhpStanExtractor
when constructor has no docblockHtmlDumper
ArrayLoader
CsrfTokenClearingLogoutListener
with stateless logoutdd()
showing line withnull
container.excluded
tag%
from parameter-like default valuesAbstractNormalizer::OBJECT_TO_POPULATE
aud
andiss
claims on OidcTokenHandlerAbstractNormalizer::OBJECT_TO_POPULATE
false
boolean env varsStopWorkerOnSignalsListener::$signals
to be assigned to null in caseSIGTERM
constant doesn't existtrue
typedebug:config
&config:dump
in debug modeContainerAwareEventManager
debug:config
&config:dump
list view & completionmessage
option to thePasswordStrength
constraintisRetryable
decision of the retry strategy when deciding if failed message should be re-delivered"security.remember_me_aware