Fixed ASBasicImageDownloader to handle multiple requests with the same… - #476
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Thanks! I have a finished-but-incompletely-tested version of this locally, but it's awesome to have the community step in and finish the job more quickly than I could. |
|
Looks good overall, but importantly:
If you're able to ensure that the task is only created once and is thread-safe (so that a caller definitely gets its callback even if the task is finishing right around the moment it's putting in the download request), I'll merge this diff right away and prepare a 1.2.1 release. Thanks so much, @victormayorov! |
|
@appleguy, thanks for your comments! Regarding new tasks for each request - it was implemented in similar way before. Now it creates new task only if another one has already finished. See -[ASBasicImageDownloaderContext createSessionTaskIfNecessaryWithBlock:] for details. ASDN::MutexLocker l(_propertyLock) inside this method ensures that sessionTask is synchronized. Thank you, I'll be waiting for fix of this bug in 1.2.1 release. |
|
Oh cool! My quick skim of the code (while in a meeting lol) missed that part and looked like it was unconditionally created. That sounds perfect, will merge tonight. |
|
Ok, I'm actually so happy with your attention to detail here that I am going to merge from a mobile device without even testing it -- LOL. Seriously, thank you @victormayorov! I'll test tonight and aim to get a release out this weekend once I can tell which of two or three other important diffs can land in time. |
Fixed ASBasicImageDownloader to handle multiple requests with the same…
|
@victormayorov Can you test this with the Kittens app in the simulator? I'm getting crashes and may need to revert it unless it can be shown not to be caused by this diff. Thread 1Queue : com.apple.main-thread (serial) |
|
Wow cool can't wait to try this release On Thu, Jun 11, 2015 at 12:55 AM, victormayorov notifications@github.com
|
facebookarchive#476) * Be more aggressive at invalidating layouts during transitions, add a debug method, fix some build errors when verbose logging * Add a changelog entry
… URL