feature/gzip#131
Open
VB10 wants to merge 4 commits into
Open
Conversation
VB10
commented
May 16, 2025
Owner
- 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.
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;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.