Skip to content

Ensure we get the last error from Windows on the same thread#15564

Merged
zanieb merged 1 commit intomainfrom
zb/auth-win-safety
Aug 27, 2025
Merged

Ensure we get the last error from Windows on the same thread#15564
zanieb merged 1 commit intomainfrom
zb/auth-win-safety

Conversation

@zanieb
Copy link
Member

@zanieb zanieb commented Aug 27, 2025

Reverts #15552
Closes #15562
Closes #15558

The GetLastError calls must be on the same thread, or we can pull the wrong last error!

@zanieb zanieb added the bug Something isn't working label Aug 27, 2025
@zanieb zanieb force-pushed the zb/auth-win-safety branch 2 times, most recently from 26eb8cb to a2ade69 Compare August 27, 2025 21:20
})
.await?
{
0 => Err(decode_error()),
Copy link
Member Author

Choose a reason for hiding this comment

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

Notice here we called decode_error which invokes GetLastError outside of the credential delete thread

Copy link
Member Author

Choose a reason for hiding this comment

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

cc @oconnor663 just so you're aware of the gotcha in the future :)

@zanieb zanieb added windows Specific to the Windows platform preview Experimental behavior internal A refactor or improvement that is not user-facing and removed preview Experimental behavior labels Aug 27, 2025
@zanieb zanieb marked this pull request as ready for review August 27, 2025 21:21
@zanieb zanieb force-pushed the zb/auth-win-safety branch from a2ade69 to 8581db2 Compare August 27, 2025 21:25
@zanieb zanieb enabled auto-merge (squash) August 27, 2025 21:25
@zanieb zanieb temporarily deployed to uv-test-registries August 27, 2025 21:32 — with GitHub Actions Inactive
@zanieb zanieb merged commit 17a86d8 into main Aug 27, 2025
96 checks passed
@zanieb zanieb deleted the zb/auth-win-safety branch August 27, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working internal A refactor or improvement that is not user-facing windows Specific to the Windows platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows keyring access can fail with error code 6

1 participant