Skip to content

Conversation

@ahmtydn
Copy link
Contributor

@ahmtydn ahmtydn commented May 11, 2025

Summary

This pull request introduces several changes and improvements to the Vexana library. Below is a summary of the modifications:

Changes

  • INetworkManager Interface: Updated to include a second generic parameter P for enhanced flexibility.
  • NetworkManager Class: Refactored to support the new generic parameter P and added methods for handling custom parameters and refresh tokens.
  • Mixin Updates:
    • Updated NetworkManagerOperation, NetworkManagerCache, NetworkManagerResponse, and other mixins to support the new generic parameter P.
    • Added support for custom parameters and improved error handling.
  • Tests:
    • Updated all test cases to align with the new INetworkManager interface and NetworkManager class changes.
    • Added tests for custom parameter handling and refresh token logic.
  • Documentation: Updated inline comments and documentation to reflect the new changes.

Bug Fixes

  • Fixed issues with caching logic in NetworkManagerCache.
  • Resolved errors in NetworkManagerErrorInterceptor related to unauthorized requests.

Breaking Changes

  • The INetworkManager interface now requires two generic parameters.
  • All usages of NetworkManager need to be updated to include the second generic parameter.

Additional Notes

  • Ensure to update your implementation to use the new INetworkManager<E, P> interface.
  • Refer to the updated test cases for examples of the new usage.

Checklist

  • Code changes are tested.
  • Documentation is updated.
  • Breaking changes are documented.

ahmtydn added 10 commits May 10, 2025 22:24
- Updated `_updateParameters` to allow toggling `handleRefreshToken` for individual requests.
- Enhanced the `send` method to support optional `handleRefreshToken` parameter.
- Ensured backward compatibility by defaulting to existing behavior when `handleRefreshToken` is not provided.
- Updated `_updateParameters` to allow toggling `handleRefreshToken` for individual requests.
- Enhanced the `send` method to support optional `handleRefreshToken` parameter.
- Ensured backward compatibility by defaulting to existing behavior when `handleRefreshToken` is not provided.
- Updated INetworkManager to include a generic parameter for custom parameters.
- Modified NetworkManager and its mixins to handle custom parameters.
- Enhanced type safety across the network manager implementation.
- Updated example usage in json_place_holder_view_model.dart.
- Adjusted caching and error handling logic to accommodate new parameterization.
@ahmtydn
Copy link
Contributor Author

ahmtydn commented May 11, 2025

Migration Note: ⚠️

This PR introduces a breaking change by requiring a second generic parameter P in the INetworkManager<E, P> interface. Existing implementations that do not supply this parameter will result in type errors after upgrading the package.

⚠️ All users of NetworkManager must now provide both generic parameters explicitly.

✅ TODO: The README and migration guide must be updated to reflect these changes, including:

  • How to define the new generic parameter P
  • How to update existing usages of NetworkManager and INetworkManager
  • Example usage with the new API

Copy link
Owner

@VB10 VB10 left a comment

Choose a reason for hiding this comment

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

@ahmtydn thank you for some coding fixes but i think this changes getting a lot of migration for couple of business project and third param it not useless you can manage extra param in your application side.

Vexana just only handle about network logic.
Thanks again but not need now.

@VB10 VB10 closed this May 16, 2025
@VB10 VB10 reopened this May 16, 2025
@VB10 VB10 closed this May 16, 2025
@ahmtydn ahmtydn deleted the feature/optional-parameters-and-refresh-token branch May 18, 2025 16:15
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