Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Notifier] FailoverTransport does not always pick the first transport #40895

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
ngrie opened this issue Apr 21, 2021 · 1 comment
Closed

[Notifier] FailoverTransport does not always pick the first transport #40895

ngrie opened this issue Apr 21, 2021 · 1 comment

Comments

@ngrie
Copy link

ngrie commented Apr 21, 2021

Symfony version(s) affected: >= 5.0

Description
Since the FailoverTransport extends the RoundRobinTransport where the next transport is randomly chosen, this behaviour also applies when configuring failover when sending chat or text messages. The expected behaviour would be: The first transport is always used unless sending fails.

How to reproduce
Configure failover transports as stated in the docs: https://symfony.com/doc/current/notifier.html#configure-to-use-failover-or-round-robin-transports

Possible Solution
Apply a similar fix as for the Mailer failover transport in #37611

@jschaedl
Copy link
Contributor

I can take a look, add some tests first and try to fix this bug.

@fabpot fabpot closed this as completed May 6, 2021
fabpot added a commit that referenced this issue May 6, 2021
…ansport (jschaedl)

This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Make FailoverTransport always pick the first transport

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| 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 #40895 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->
<!--
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/releases):
 - 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 5.x.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->

Commits
-------

337f828 Make FailoverTransport always pick the first transport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants