-
Notifications
You must be signed in to change notification settings - Fork 2
``[noref] Fix with claude #767
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
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 87425f8 in 2 minutes and 8 seconds. Click for details.
- Reviewed
383lines of code in2files - Skipped
2files when reviewing. - Skipped posting
5draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. client.go:55
- Draft comment:
Avoid double deferring Close; let the caller manage response.Body closing. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
2. client.go:35
- Draft comment:
Consider setting a timeout on the http.Client to avoid hanging requests. - Reason this comment was not posted:
Comment was on unchanged code.
3. shift.go:84
- Draft comment:
Reuse the Bl3Client's HTTP client in GetFullShiftCodeList instead of creating a new one. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. shift.go:94
- Draft comment:
Avoid using 'json' as a variable name to prevent shadowing the encoding/json package. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. client.go:221
- Draft comment:
The error message "SHiFT login service is temporarily unavailable (503)..." uses an inconsistent capitalization compared to the rest of the code (e.g. "shift.gearboxsoftware.com"). Consider using consistent capitalization (e.g., "SHIFT" or "shift") for clarity. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 0% vs. threshold = 50% This is a very minor stylistic suggestion about capitalization in an error message. SHiFT appears to be a brand name and may have official capitalization. The inconsistency doesn't impact functionality or code quality. This seems like the kind of nitpicky comment we should avoid. The comment could be valid if there's a strong style guide requirement for consistent capitalization. The current mixed capitalization could be slightly confusing to users. Brand names often have specific capitalization that differs from normal text. This is a user-facing error message where the exact capitalization of SHiFT is not critical to understanding. Delete this comment as it's too minor and focuses on non-functional aspects of an error message string.
Workflow ID: wflow_9dy29EacmEw5bxYl
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
| // Extract session cookie from response | ||
| cookies := loginRes.Header.Values("Set-Cookie") | ||
| for _, cookie := range cookies { | ||
| if len(cookie) >= 12 && cookie[:12] == "_session_id=" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use strings.HasPrefix for cookie prefix check instead of manual slicing.
| if len(cookie) >= 12 && cookie[:12] == "_session_id=" { | |
| if strings.HasPrefix(cookie, "_session_id=") { |
| // If it's a redirect to somewhere else, it's likely successful | ||
| if location != "" { | ||
| // Extract session cookie from response | ||
| cookies := loginRes.Header.Values("Set-Cookie") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor duplicate session cookie extraction logic into a helper function.
Important
Update SHiFT client to handle CSRF tokens, manual redirects, and reflect API discontinuation.
Login()inclient.goto handle CSRF tokens and improve error handling for login failures.RedeemShiftCode()inshift.goto return an error message indicating the discontinuation of the 2K Borderlands API.GetCodePlatforms()andGetShiftPlatforms()inshift.go.CheckRedirectfunction inNewHttpClient()inclient.goto handle redirects manually.NewHttpClient()to mimic a real browser.getResponse()inclient.gofor nil responses.NewBl3Client()inclient.gofor reading and parsingconfig.json.This description was created by
for 87425f8. You can customize this summary. It will automatically update as commits are pushed.