api_request_handler 0.1.0
api_request_handler: ^0.1.0 copied to clipboard
A package for handling API requests with Dio with cache functionality and auto cancel duplicate requests.
0.1.0 #
- Fix: Hive cache is now stored in the platform cache directory instead of the app Documents directory, so
.hive/.lockfiles no longer show up in the iOS Files app. Leftover files from the old location are cleaned up automatically on first launch after upgrading. - Fix: cache key generation now sorts params and includes HTTP method + client name, so equivalent params in a different order hit the cache correctly, and the same endpoint on different clients/methods no longer collides.
- Fix: duplicate in-flight requests (same endpoint/method/params/client) now actually get cancelled when a newer identical request starts, instead of only tracking a cancel token that was never used.
- Fix:
ApiParser.parseResponseis now applied to responses and no longer throws on a list of non-map items. - Add:
enableLogging,connectTimeout/receiveTimeout/sendTimeout,defaultCacheDuration, andmaxCacheEntriesoptions oninitialize/initializeMultipleClients. - Add: optional retry with backoff for transient network errors via
configureRetries()or per-callretries/retryDelay. - Add:
onSendProgress/onReceiveProgresspassthrough onrequest(). - Add:
requestTyped<T>()for typed responses viafromJson. - Add:
requestPaginated<T>()+PaginatedResponse<T>for list endpoints, withclearCacheForEndpoint()to invalidate all cached pages of a resource at once. - Add:
clearAllCache(). - Add:
AuthInterceptorbase class for the token-attach + refresh-on-401 pattern. - Add:
isConnectedCheckerhook to fail fast when offline instead of waiting on a socket timeout. - Test: added unit test coverage for
ApiParserandCacheService.
0.0.1 #
- initial release.