refactor(core): unify network layer into a shared singleton provider#50
refactor(core): unify network layer into a shared singleton provider#50
Conversation
syed-tp
commented
Mar 26, 2026
- Centralize multiple client instances to ensure consistent request handling.
- Eliminate redundant connection pools and enable global 401 session invalidation.
- Consolidate device metadata logic into the unified network stack to reduce boilerplate.
Summary of ChangesHello, 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 significantly refactors the core network layer to establish a more robust, maintainable, and efficient architecture. By unifying the Highlights
🧠 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 AssistThe 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
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 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors the network layer to centralize Dio instance management using a Riverpod dioProvider, enhancing authentication handling with a 'smart' AuthInterceptor. The AuthInterceptor now supports path-aware token injection, excluding login paths, and includes an onError handler for global 401 unauthorized response handling. Additionally, the UserAgentHelper logic has been merged directly into UserAgentInterceptor for streamlining, and network services now receive Dio instances via constructor injection. A review comment points out that the AuthInterceptor.onError implementation does not include the warning log for 401 errors as specified in the design document, suggesting an alignment between the design and implementation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f2eb01827
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c14c07a to
37e6aef
Compare
…l 401 handling, and streamline User-Agent logic.
…eptor's 401 handling for auth flow paths.
6552994 to
8ce80bf
Compare
…d performNetworkRequest utility
…for reactive dependency tracking
…ils while renaming factory constructor to fromDioException
…ourceProvider to prevent circular dependencies