Commit Graph

43679 Commits

Author SHA1 Message Date
Nicolas Grekas 06e745847d bug #34198 [HttpClient] Fix perf issue when doing thousands of requests with curl (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix perf issue when doing thousands of requests with curl

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Performing while scheduling requests was a terrible idea: it makes buffers fill in memory and requires CPU do deal with the pending list, while all this in dealt with much more efficiently by any response-reading code that comes after.

Commits
-------

e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl
2019-10-31 14:38:12 +01:00
Nicolas Grekas e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl 2019-10-31 08:19:20 +01:00
Nicolas Grekas e8b31ff608 minor #34176 [4.3] Remove unused local variables (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[4.3] Remove unused local variables

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.

Commits
-------

58161b8eec [4.3] Remove unused local variables
2019-10-30 14:18:51 +01:00
Thomas Calvet 58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas 1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas 27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

| Q             | A
| ------------- | ---
| Branch?       | 3.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 #33990  <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | no <!-- required for new features -->

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin 3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas 1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Nicolas Grekas c424c5adb7 bug #34186 [HttpClient] always return the empty string when the response cannot have a body (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] always return the empty string when the response cannot have a body

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This will fix tests on 4.4 also.

Commits
-------

f78e14332e [HttpClient] always return the empty string when the response cannot have a body
2019-10-30 13:01:49 +01:00
Nicolas Grekas f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Yonel Ceruto 2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau 5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas 2326f2882c bug #34167 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() (dunglas)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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
| License       | MIT
| Doc PR        | n/a

This parameter was already deprecated in Symfony 4. Allowing to not pass it in Symfony 4.3 without triggering a deprecation allows to support both HttpFoundation 4.3 and 4.4, otherwise it's not possible.

Needed to make API Platform compatible with Symfony 5 (https://github.com/api-platform/core/pull/3009)

Commits
-------

e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:51:20 +01:00
Kévin Dunglas e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Thomas Calvet ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Kévin Dunglas ee4b99f227
bug #33828 [DoctrineBridge] Auto-validation must work if no regex are passed (dunglas)
This PR was squashed before being merged into the 4.3 branch (closes #33828).

Discussion
----------

[DoctrineBridge] Auto-validation must work if no regex are passed

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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
| License       | MIT
| Doc PR        | n/a

Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).

Commits
-------

5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:03:42 +01:00
Kévin Dunglas 5ed7d6c759
[DoctrineBridge] Auto-validation must work if no regex are passed 2019-10-29 11:03:05 +01:00
Robin Chalas f233259c68 remove outdated workflow test 2019-10-29 03:10:02 +01:00
Robin Chalas 6c2253415f drop wrong test (fix merge) 2019-10-29 02:54:26 +01:00
Nicolas Grekas 7b3d5cd615 minor #34157 [OptionsResolver] Fix an error message to be more accurate (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30432
| License       | MIT
| Doc PR        | -

Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3

Commits
-------

1be68a752a Fix an error message to be more accurate
2019-10-28 22:53:11 +01:00
Yonel Ceruto 1be68a752a Fix an error message to be more accurate 2019-10-28 16:59:01 -04:00
Robin Chalas 2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - 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 branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
Nicolas Grekas 15f08553be [OptionsResolve] Revert change in tests for a not-merged change in code 2019-10-28 18:16:45 +01:00
Nicolas Grekas 6d5c91bb47 Merge branch '3.4' into 4.3
* 3.4:
  #30432 fix an error message
  fix paths to detect code owners
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  Remove unused local variables in tests
  Make sure to collect child forms created on *_SET_DATA events
  do not render errors for checkboxes twice
2019-10-28 18:07:32 +01:00
Nicolas Grekas 48533ff3f1 bug #34152 [Workflow] Made the configuration more robust for the 'property' key (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Made the configuration more robust for the 'property' key

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34092
| License       | MIT
| Doc PR        |

Commits
-------

0c31ff007e [Workflow] Made the configuration more robust for the 'property' key
2019-10-28 17:55:19 +01:00
Nicolas Grekas fd5b8def49 bug #34154 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

A `304` is the final response code.
This PR implements the same logic as curl.

Commits
-------

50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
2019-10-28 17:53:30 +01:00
Nicolas Grekas 50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected 2019-10-28 16:45:56 +01:00
Grégoire Pineau 0c31ff007e [Workflow] Made the configuration more robust for the 'property' key 2019-10-28 15:45:57 +01:00
Robin Chalas 3be177a93f bug #34140 [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

sodium implementations are always faster, let's use them when possible. This also allows validating argon2 passwords when bcrypt is configured as the main one, making migrations possible.

Commits
-------

799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
2019-10-28 10:35:50 +01:00
Nicolas Grekas 799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible 2019-10-28 10:20:18 +01:00
Fabien Potencier 8920672b2e minor #34127 fix paths to detect code owners (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix paths to detect code owners

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

I was wondering why sometimes I didn't receive any notifications for PRs where I thought a file for which I claimed code ownership was modified. Turns out according to https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax the `dir/*` pattern does not include nested directories.

Commits
-------

cb7523d595 fix paths to detect code owners
2019-10-26 21:54:01 +02:00
Yonel Ceruto fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30432
| License       | MIT
| Doc PR        |

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro 7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Yonel Ceruto 2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #29291
| License       | MIT
| Doc PR        | -

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Christian Flothmann cb7523d595 fix paths to detect code owners 2019-10-26 10:25:32 +02:00
Fabien Potencier 591ad2203c bug #34090 [WebProfilerBundle] Improve display in Email panel for dark theme (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle] Improve display in Email panel for dark theme

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Improve the email panel readability when using dark theme

## before
<img width="496" alt="Capture d’écran 2019-10-23 à 19 54 59" src="https://user-images.githubusercontent.com/4977112/67420667-5d11e500-f5cf-11e9-91c6-75d2f55a32e7.png">

## after
<img width="492" alt="Capture d’écran 2019-10-23 à 19 53 26" src="https://user-images.githubusercontent.com/4977112/67420679-626f2f80-f5cf-11e9-8762-ad56978c1ac8.png">

Commits
-------

402fed02e7 [WebProfilerBundle] Improve display in Email panel for dark theme
2019-10-26 10:23:07 +02:00
Christian Flothmann ccc5667df8 minor #34100 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This method is internal and unused. It was removed by a2ae6bf745 but was added back mistakenly by 1baac5a74f.

Commits
-------

49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
2019-10-26 09:13:46 +02:00
Christian Flothmann 48d189b46b minor #34112 [SecurityBundle] Fix wrong assertion (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix wrong assertion

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

8e56f46150 [SecurityBundle] Fix wrong assertion
2019-10-26 09:11:52 +02:00
Fabien Potencier 6c08ac599e bug #34116 [HttpClient] ignore the body of responses to HEAD requests (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] ignore the body of responses to HEAD requests

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34102
| License       | MIT
| Doc PR        | -

Commits
-------

0fc371e7df [HttpClient] ignore the body of responses to HEAD requests
2019-10-25 15:21:40 +02:00
Nicolas Grekas 0fc371e7df [HttpClient] ignore the body of responses to HEAD requests 2019-10-25 15:08:37 +02:00
Tobias Schultze c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.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 #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott 6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00
Tobias Schultze 8bf8c50363 bug #32456 [Messenger] use database platform to convert correctly the DateTime (roukmoute)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] use database platform to convert correctly the DateTime

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32427
| License       | MIT

In Doctrine Messenger the method `\Symfony\Component\Messenger\Transport\Doctrine\Connection::formatDateTime()` is used to format dateTime into this: `Y-m-d\TH:i:s`.
But this is not supported in all databases platform.

Here we use the database platform to convert correctly the dateTime.

Commits
-------

cfa11561d1 Format DateTime depending on database platform
2019-10-25 12:57:14 +02:00
Tobias Schultze 13853d575d bug #34107 [Messenger] prevent infinite redelivery loops and blocked queues (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] prevent infinite redelivery loops and blocked queues

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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 #32055
| License       | MIT
| Doc PR        |

This PR solves a very common fitfall of amqp redeliveries. It's for example explained in https://blog.forma-pro.com/rabbitmq-redelivery-pitfalls-440e0347f4e0
Newer RabbitMQ versions provide a solution for this by itself but only for quorum queues and not the classic ones, see https://github.com/rabbitmq/rabbitmq-server/pull/1889

This PR adds a middleware that throws a RejectRedeliveredMessageException when a message is detected that has been redelivered by AMQP.

The middleware runs before the HandleMessageMiddleware and prevents redelivered messages from being handled directly. The thrown exception is caught by the worker and will trigger the retry logic according to the retry strategy.

AMQP redelivers messages when they do not get acknowledged or rejected. This can happen when the connection times out or an exception is thrown before acknowledging or rejecting. When such errors happen again while handling the redelivered message, the message would get redelivered again and again. The purpose of this middleware is to prevent infinite redelivery loops and to unblock the queue by republishing the redelivered messages as retries with a retry limit and potential delay.

Commits
-------

d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
2019-10-25 12:52:06 +02:00
Robin Chalas 8e56f46150 [SecurityBundle] Fix wrong assertion 2019-10-25 10:35:42 +02:00
Mathias STRASSER cfa11561d1
Format DateTime depending on database platform 2019-10-25 10:13:54 +02:00
Tobias Schultze 278280a246 minor #34105 Remove unused local variables (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove unused local variables

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR removes useless assignations. There are also somes fixes in tests.

Commits
-------

c07cee8f61 Remove unused local variables in tests
2019-10-25 04:33:49 +02:00
Tobias Schultze d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
by republishing the redelivered messages as retries with a retry limit and potential delay
2019-10-24 18:35:41 +02:00
Thomas Calvet c07cee8f61 Remove unused local variables in tests 2019-10-24 17:33:53 +02:00
Thomas Calvet 49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method 2019-10-24 12:09:03 +02:00