This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
eseliger
approved these changes
Jul 10, 2024
camdencheek
approved these changes
Jul 10, 2024
Member
|
Upstream an |
Member
|
They froze the package. I personally think this is quite acceptable, it's just composing the net and smpt packages together into something we like to use 🤔 |
Contributor
Author
Member
Oh, agreed! Mostly just thought this would be a fun little opportunity to contribute to stdlib since adding context-accepting variants is pretty standard across stdlib. Didn't realize the package was frozen though |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Before, the smtp.Dial function had no cancellation mechanism - meaning that you could be waiting for several minutes to try to establish a connection before it gives up.
I work around this by establishing a TCP connection myself to the appropriate address, and using net.DialContext to cancel the dial process if either:
Afterwards, we construct the smtp.Client ourselves using smtp.NewClient
This only changes what happens when we try to establish a connection - it doesn't change any behavior around sending emails afterwards.
Test plan
Manual testing.
On local dev, I edited the credentials in the dev-private site configuration file to point to an invalid port.
I attempted to create an access token, and after only30 seconds I saw this error print in the terminal:
Changelog