Skip to content

Conversation

@VB10
Copy link
Owner

@VB10 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

@VB10 VB10 requested a review from Copilot May 16, 2025 08:37
@VB10 VB10 self-assigned this May 16, 2025
@VB10 VB10 added the enhancement New feature or request label May 16, 2025
Copy link

Copilot AI left a 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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants