Skip to content

Conversation

taylorsilva
Copy link
Member

@taylorsilva taylorsilva commented Jul 29, 2025

Changes proposed by this PR

closes #9244 and properly resolves #2414 instead of patching around it by disabling manual token entry.

Notes to reviewer

BrowserOnly on the LoginCommand struct was initially added to fix #2414

This PR fixes that issue. The Reader will now close after a successful login, even if it wasn't used.

I tested this change on macOS, linux, and Windows (Powershell). I ran fly set-pipeline so there would always be a second prompt (the yN prompt) after logging in. I was always able to interact with the yN prompt after logging in using manual entry or with the automatic browser flow.

I did notice that I had to press a key to "focus" onto the yN prompt after logging in with the automated browser flow. Not exactly sure why that happens, but after pressing any key, I was able to fully interact with the yN prompt. I threw some temporary debug statements in while testing to confirm that the pty.ReadLine() did exit. If someone wants to figure out that last little hiccup, they can make a PR addressing that.

BrowserOnly was initially added to fix #2414

This commit also fixes that issue. The Reader will now close after a
successful login, even if it wasn't used.

I tested this change on macOS, linux, and Windows (Powershell). I ran
`fly set-pipeline` so there would always be a second prompt (the Y/n
prompt) after logging in.

Signed-off-by: Taylor Silva <dev@taydev.net>
@taylorsilva taylorsilva requested a review from a team as a code owner July 29, 2025 17:41
Signed-off-by: Taylor Silva <dev@taydev.net>
@taylorsilva taylorsilva merged commit 79611f1 into master Jul 29, 2025
12 checks passed
@taylorsilva taylorsilva deleted the issue-9244 branch July 29, 2025 19:57
@taylorsilva taylorsilva mentioned this pull request Jul 29, 2025
25 tasks
@taylorsilva
Copy link
Member Author

I figured out why there's that input focus hiccup. The io.Reader doesn't close until it reads something from stdin. Tried to see if there was a way to kill that io.Reader attached to stdin, but doesn't seem easily fixable. Very annoying!
https://benjamincongdon.me/blog/2020/04/23/Cancelable-Reads-in-Go/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Running fly set-pipeline when your token expired results in a hang. fly command not accepting user input after returning from auto login flow
1 participant