Skip to content
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

[Lock][Messenger] Fix precedence of DSN options for 5.1 #37269

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

jderusse
Copy link
Member

@jderusse jderusse commented Jun 13, 2020

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets #37218 (comment)
License MIT
Doc PR N/A

This PR fix précédence of DSN options over constructor options in all component on branch 5.1

@nicolas-grekas
Copy link
Member

There are some failures to take care of.

@jderusse jderusse force-pushed the fix-precedence-51 branch 2 times, most recently from b409d15 to c4942b8 Compare June 14, 2020 19:11
@@ -120,7 +120,7 @@ public function __construct($mongo, array $options = [], float $initialTtl = 300
if (isset($parsedUrl['query'])) {
parse_str($parsedUrl['query'], $query);
}
$this->options['collection'] = $this->options['collection'] ?? $query['collection'] ?? null;
$this->options['collection'] = $query['collection'] ?? $this->options['collection'] ?? null;
Copy link

@kralos kralos Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a BC Break? someone's application could start writing to the wrong collection if they are specifying both for some reason and they differ. Also there's the path in the uri which should take precedence over $options['database']

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather we deal with Lock\Store\MongoDbStore in #37218

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #37218 (comment) about BC vs bugfix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's the path in the uri which should take precedence over $options['database']

@jderusse can you have a look at this, also in the other PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. Also fix precedenceof credentials in that PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did not found precendence in #37268 @nicolas-grekas . Did you have a specific thing in mind?

@nicolas-grekas
Copy link
Member

Thank you @jderusse.

@nicolas-grekas nicolas-grekas merged commit ab24fb9 into symfony:5.1 Jun 18, 2020
@fabpot fabpot mentioned this pull request Jul 24, 2020
fabpot added a commit that referenced this pull request Jul 31, 2020
… (jderusse)

This PR was merged into the 5.1 branch.

Discussion
----------

[Messenger] Fix invalid option sslmode in AmazonSqs bridge

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

The sslmode option allows people to use AmazonSqs with non-offical endpoint like the [asyncaws/testing-sqs](https://hub.docker.com/r/asyncaws/testing-sqs) docker image

By fixing precedence of DNS options in #37269 I introduced a bug that trigger an exception `Unknown option found: [sslmode]`. I apologize for this

This PR adds `sslmode` in list of allowed options

Commits
-------

afbd51b Fix invalid option sslmode
@jderusse jderusse deleted the fix-precedence-51 branch October 15, 2020 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants