Closed oSumAtrIX closed 1 year ago
QueuedInterceptorsWrapper
may help to resolve this.
The original issue https://github.com/cfug/dio/issues/590
Here's an example (untested):
final cache = DioCacheInterceptor(options: cacheOptions);
dio = Dio()
..interceptors.add(
QueuedInterceptorsWrapper(
onRequest: cache.onRequest,
onResponse: cache.onResponse,
onError: cache.onError,
),
);
Unfortunately, this had no effect. But I assume this is the wrong repository. Thanks.
This issue may not belong in this repo but in DIO.
Issue
The cache interceptor saves the response to the cache in the
onResponse
implementation. When I make 2 identical requests asynchronously but do not read the response yet, both requests will not be caught by the cache. I assume the reason for this is that the 2 requests were made at the time when the cache was not present, becauseonResponse
has not been called yet.Observations
/tools
endpoint is not being cached.Reproduction
You can reproduce this issue on our repository: https://github.com/revanced/revanced-manager.