-
Notifications
You must be signed in to change notification settings - Fork 43
feature/gzip #131
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: master
Are you sure you want to change the base?
feature/gzip #131
Conversation
VB10
commented
May 16, 2025
- chore: update .gitignore to exclude lock files
- feat: add compression support and related exceptions
- feat: add gzip compression support and related tests
- refactor: remove unused imports from network manager 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.
Pull Request Overview
This PR adds gzip compression support to network requests and responses while also cleaning up imports and test cases. Key changes include:
- Adding a new compressionType parameter and updating request body generation to handle gzip compression.
- Introducing tests and a compression service with related exceptions for gzip support.
- Refactoring existing tests and imports (e.g., fixing a typo in file_manager_not_found_exception).
Reviewed Changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit/network_manager_test.dart | Added compressionType parameter to test network manager requests. |
| test/unit/network_manager_error_test.dart | Updated parseModel usage to use const constructors and refactored helper code. |
| test/unit/model/custom_exception_test.dart | Fixed import typo for file_manager_not_found_exception. |
| test/feature/refresh-token/refresh_user_token_test.dart | Removed unnecessary isServiceOn flag from tests. |
| test/feature/compression_test/compression_user.dart | Introduced a new model for testing compression functionality. |
| test/feature/compression_test/compression_gzip_test.dart | Added tests to validate gzip compressed responses and proper decompression. |
| pubspec.yaml | Added archive dependency for compression functionality. |
| lib/vexana.dart | Exported the compression type file for public API support. |
| lib/src/network_manager.dart | Updated request methods to support compressionType and adjusted error handling. |
| lib/src/model/error/compression_exception.dart | Added a dedicated exception class for compression errors. |
| lib/src/mixin/network_manager_response.dart | Modified request body generation to utilize compression when applicable. |
| lib/src/mixin/network_manager_cache.dart | Fixed the import error for file_manager_not_found_exception. |
| lib/src/interface/i_network_manager.dart | Updated the network manager interface to include compressionType. |
| lib/src/feature/compression/network_compression_type.dart | Added an enum representing supported compression types. |
| lib/src/feature/compression/network_compression_service.dart | Created a compression service for handling gzip compression. |
| lib/src/feature/adapter/web_adapter.dart | Improved adapter initialization styling. |
| example/lib/json_place_holder/model/post.dart | Refactored JSON deserialization with explicit type casts. |
| analysis_options.yaml | Adjusted analyzer exclusion for the example directory. |
| .vscode/settings.json | Updated settings for formatting and spell-check customizations. |
Comments suppressed due to low confidence (2)
lib/src/mixin/network_manager_response.dart:158
- [nitpick] Consider providing a default value for the 'compressionType' parameter (e.g., NetworkCompressionType.none) to simplify function calls and reduce repetitive code when compression is not needed.
dynamic makeRequestBodyData(dynamic data, NetworkCompressionType compressionType) {
test/feature/compression_test/compression_gzip_test.dart:62
- [nitpick] Ensure that the model used for testing decompression (EmptyModel) has a property 'name' or consider using a more appropriate model that reflects the expected response structure for a gzip compressed endpoint.
final responseBody = response.data?.name;