Open ttkk0000 opened 9 years ago
when all the requests has the same cacheKey, the Cache is unvailable, and the delay time is enough long, a request is after the foregoing request have successfule response to be send out, when the request's response is returned , the new mBatchedResponses cachekey will cover the old. as a result, only one imageview is setted, others are default images.
the above pictures(the first is the issue, the second one is the normal situation) show that: the last request's returned batchresponse covered the old cachekey and result to the first picture's situation.
there is bug in function batchResponse().
I have add some logs to track this issue, such as follow: if(mBatchedResponses.containsKey(cacheKey)) { Log.e("BatchedImageRequest", "_+" + cacheKey + "+_"); } mBatchedResponses.put(cacheKey, request);
when this bug happen , the log Log.e("BatchedImageRequest", "_+" + cacheKey + "+_") is executed. and the follow statement "mBatchedResponses.put(cacheKey, request); " cover the old cacheKey.
I have a suggestion for this issue, like this: if(mBatchedResponses.containsKey(cacheKey)) { mBatchedResponses.get(cacheKey).mContainers.addAll(request.mContainers) } else { mBatchedResponses.put(cacheKey, request); }
If you have any idea about this issue , pls send me a email. my email address is ttkk0000@gmail.com