Avoid cancel same image loading in same View instance#3569
Avoid cancel same image loading in same View instance#3569BrunoMa0429 wants to merge 2 commits intoSDWebImage:masterfrom
Conversation
Add image url same check logic to avoid cancel same image loading and load repeatedly.
remove duplicated operation cancel
|
Looks OK on But...Maybe need a way to workaround I write a implementation 2 years ago but has no response, which is ugly and hacky so I close it and forgot that... #2790 |
oh @dreampiggy, thanks for your review and let me try to understand what is your point, do you mean the view who can be set multiple images, when we try to load images for different state at the same time, in current sd_internalSetImageWithURL function, the multiple image loading operation will canceled each other, this is what you want to fix right? |
I don't want to fix this, but if user use UIButton, your new code will cause But I don't think it's your duty to fix this bad design about UIButton in this PR. Maybe it still need me to re-open #2790, and then you don't touch |
|
A better idea is to mark some warning in |
|
No, this is not designed as public API, only for SD's third-party integration (like that FirebaseStorageUI integration) to use. |
Previously, this:
However, after you changes, since Will cause that UIButton's touchUpInside no longer set any image, and will cause blank when user touch. It's already buggy, but this new But this is SDWebImage's old design issue, not your duty. If you want to merge, maybe I have to pick up #2790 and merge it before your PR merged in |
|
You can guess what I means, that Until I provide new API like |
it could help to avoid image loading canceled right? |
|
That One Image Request from UI level, can bind to 3 states:
Means, it can be a It's not URL or Cache Key, which is data-source. It's a UI state management problem (I think SD is not a UI framework, but users think...They put the problem to us) This is history bad design for multi-state-image-view. So, you shoud not rely on If I provide the API like |
|
In SD 6.0, I decide to provide new API for Swift user to always pass |
|
@mTz0206 See #3576 You need the new API from that and then merge-in. |
|
Any update ? Do we still need this PR ? I suggest to add a new option (to not cancel current loaded image request) |
thanks, I will review this > See #3576 |
|
I can provide a draft PR for you actually. Check if this match your feature request. |
oh really? thank for that. |
|
See #3592's test case about the new behavior. I guess this is enough for you ? By the way, I think in the more complicated scenario, you can directly call |




New Pull Request Checklist
I have read and understood the CONTRIBUTING guide
I have read the Documentation
I have searched for a similar pull request in the project and found none
I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)
I have added the required tests to prove the fix/feature I am adding
I have updated the documentation (if necessary)
I have run the tests and they pass
I have run the lint and it passes (
pod lib lint)This merge request fixes / refers to the following issues: ...
Pull Request Description
#3568