Skip to content

Conversation

@geen02
Copy link

@geen02 geen02 commented Jan 27, 2026

Problem

The background refresher was skipping token files with auth_method values like "IdC" or "IDC" because the comparison was case-sensitive and only matched lowercase "idc".

This caused the background refresher to skip your token file entirely because "IdC" != "idc".

Solution

This fix normalizes the auth_method to lowercase before comparison in two places:

  1. token_repository.go: In readTokenFile() when filtering tokens to refresh
  2. background_refresh.go: In refreshSingle() when selecting the appropriate refresh method

Changes

  • Added strings.ToLower() to normalize auth_method before case-sensitive comparisons
  • Added strings import to background_refresh.go

Testing

The fix ensures that all case variations of IDC auth method ("idc", "IdC", "IDC", etc.) are properly recognized and refreshed.

The background refresher was skipping token files with auth_method values
like 'IdC' or 'IDC' because the comparison was case-sensitive and only
matched lowercase 'idc'.

This fix normalizes the auth_method to lowercase before comparison in:
- token_repository.go: readTokenFile() when filtering tokens to refresh
- background_refresh.go: refreshSingle() when selecting refresh method

Fixes the issue where 'IdC' != 'idc' caused tokens to be skipped entirely.
@gemini-code-assist
Copy link

Summary of Changes

Hello @geen02, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical bug where the background token refresher would incorrectly skip IDC token files due to a case-sensitive comparison of the auth_method field. The fix ensures that all variations of the IDC authentication method are properly recognized and processed by consistently converting the auth_method to lowercase before any comparisons, thereby preventing tokens from being overlooked.

Highlights

  • Case-insensitive Auth Method Comparison: The auth_method field is now consistently converted to lowercase before comparison in both the token repository and background refresh logic. This resolves an issue where tokens with varying casing (e.g., "IdC", "IDC") for the authentication method were being incorrectly skipped.
  • Import of strings Package: The strings package was imported into background_refresh.go to facilitate the use of the ToLower() function for case normalization.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request effectively addresses the problem of case-sensitive auth_method comparison for IDC tokens. The solution correctly normalizes the auth_method to lowercase in both token_repository.go and background_refresh.go, ensuring that all case variations are properly recognized and refreshed. The changes are well-implemented and directly resolve the identified issue, improving the robustness of the token handling logic.

@luispater luispater merged commit ee54ee8 into router-for-me:main Jan 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants