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

Use computed property to PostgresConnection.Configuration.TLS.disable for concurrency safe #376

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

sidepelican
Copy link
Contributor

@sidepelican sidepelican commented Jul 20, 2023

PostgresConnection.Configuration.TLS.disable is declared as var but it causes compiler warning on strict concurrency checking.

cocurrency error

This value seems to not to be modified in runtime.
So this should be changed to let.

…n.swift

Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
@gwynne gwynne added the bug Something isn't working label Jul 20, 2023
@sidepelican sidepelican changed the title Use let to PostgresConnection.Configuration.TLS.disable for concurrency safe Use computed property to PostgresConnection.Configuration.TLS.disable for concurrency safe Jul 20, 2023
@MahdiBM
Copy link
Contributor

MahdiBM commented Jul 20, 2023

This is a breaking change but it does seem to me that the property was supposed to be a computed property not stored.

I personally don't mind letting it slide although it's a breaking change, because it isn't supposed to be used like that anyway.

@MahdiBM
Copy link
Contributor

MahdiBM commented Jul 20, 2023

@gwynne beat me to it while i was typing on phone 😅

@sidepelican sidepelican requested a review from gwynne July 20, 2023 08:06
@gwynne gwynne dismissed their stale review July 20, 2023 08:15

My review contained inaccurate commentary.

@gwynne
Copy link
Member

gwynne commented Jul 20, 2023

It is technically a breaking change, but in this case the likelihood of someone having an actual source-compatibility issue is very low, and would have required doing something that was fairly obviously unintended.

Copy link
Member

@gwynne gwynne left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Copy link
Collaborator

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

@sidepelican Thanks for uncovering this! Really appreciated!

I'm aware that this is technically a breaking change. However, if someone actually used the set on this property, they are likely in much more trouble. For this reason, I'm fine with breaking API in a non major release.

@gwynne gwynne merged commit aa9273c into vapor:main Jul 20, 2023
@sidepelican sidepelican deleted the patch-1 branch July 20, 2023 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants