Closed mysCod3r closed 2 months ago
For deprecation case @VB10 need to decide, mb we want to keep both versions.
@mysCod3r could you fix this conflict
@mysCod3r could you fix this conflict
Sure. resolved @VB10
@mysCod3r unit test has some issue could you check it again?
@mysCod3r unit test has some issue could you check it again?
I checked and saw that 'MockNetworkManager' was duplicated and Implementation missing in CustomNetworkManager. I fixed both.
Improved Network Handling and Added New Method
sendRequest
Description
This PR introduces significant improvements to the Vexana package, focusing on enhancing network handling and ensuring backward compatibility. The key changes include:
1. New Method
sendRequest
Reason: The current
send
method, while functional, lacks the flexibility and robustness needed for more complex HTTP requests and responses.sendRequest
to provide a more robust and flexible way to send HTTP requests and handle responses. This method supports various HTTP methods, progress handling, cancellation, and caching.sendRequest
method aims to replace the oldersend
method, offering enhanced functionality and cleaner code.2. Deprecation of
send
MethodReason: To ensure backward compatibility while encouraging users to migrate to the new and improved method.
send
method has been marked as deprecated to encourage users to migrate to the newsendRequest
method.send
method is still available for backward compatibility but will be removed in future versions.3. NetworkResult Improvements
Reason: Enhance error handling and reduce unnecessary null checks, making the codebase cleaner and more maintainable.
INetworkModel
from an abstract to a sealed class to facilitate pattern matching and reduce unnecessary null checks.NetworkSuccessResult
andNetworkErrorResult
to encapsulate success and error responses, respectively.4. Additional Methods
Reason: Provide utility methods to streamline response handling and error management, improving overall code quality and maintainability.
fetchSuccessResponse
,fetchErrorResponse
,handleErrorResponse
, andloadFromCache
to streamline response handling and error management.5. Documentation
Reason: Ensure that users have clear guidance on how to use the new and modified methods.
6. Unit Tests
Reason: Ensure code reliability and functionality by thoroughly testing new and modified methods.
Changes
sendRequest
method.send
method with clear documentation.INetworkModel
to a sealed class.NetworkSuccessResult
andNetworkErrorResult
.Testing
send
method.Migration Guide
Users are encouraged to start using the
sendRequest
method. Thesend
method is deprecated but still available for use. It will be removed in future versions, so migrating tosendRequest
is recommended.Closing
These changes aim to enhance the functionality and maintainability of the Vexana package. Feedback and suggestions are welcome to further improve the package.
Thank you for considering this PR!