fix(hover): preserve warm probe cancellation#39
Merged
Conversation
Keep canceled or expired warm-session probes from falling through to the slower browser login path. Use atomic counters in warm-profile tests so httptest handler assertions stay race-free.
There was a problem hiding this comment.
Pull request overview
This PR improves the warm-session reuse flow in pkg/hoverclient by ensuring context cancellation/deadline errors from the warm-session probe are preserved (instead of falling through into credential login), makes the warm-profile login tests race-safe, and bumps plugin metadata for the next release.
Changes:
- Preserve
context.Canceled/context.DeadlineExceededfrom the warm-session probe path. - Make browser-backend login tests race-safe by switching hit counters to
sync/atomic. - Bump
plugin.jsonversion to0.5.7.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugin.json | Bumps plugin version to 0.5.7 for the release. |
| pkg/hoverclient/browser_backend.go | Updates warm-session probe error handling to preserve cancellation/deadline behavior. |
| pkg/hoverclient/browser_backend_test.go | Converts request-hit counters to atomics and adds a cancellation-specific probe test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
0.5.7for releaseVerification
GOWORK=off go test ./pkg/hoverclient -run 'TestBrowserBackend_ProbeExistingSessionReturnsContextCancellation|TestBrowserBackend_ProbeExistingSessionReturnsContextCancellationFromBodyRead|TestBrowserBackend_LoginReusesWarmBrowserProfileSession|TestBrowserBackend_LoginFallsBackWhenWarmProfileUnauthenticated' -count=1 -vGOWORK=off go test ./pkg/hoverclient -count=1GOWORK=off go test ./... -count=1wfctl plugin validate-contract --for-publish --tag v0.5.7 .git diff --checkRegression proof
With fix reverted:
GOWORK=off go test ./pkg/hoverclient -run TestBrowserBackend_ProbeExistingSessionReturnsContextCancellationFromBodyRead -count=1 -vfailed withprobeExistingSession error = <nil>, want context.Canceled.With fix restored:
GOWORK=off go test ./pkg/hoverclient -run TestBrowserBackend_ProbeExistingSessionReturnsContextCancellationFromBodyRead -count=1 -vpassed.Notes
This carries forward the post-merge Copilot follow-up from PR #38 so the DNS workflow should consume a release that includes the cancellation fix, not only the initial warm-profile reuse change.