{"action":"closed","issue":{"url":"https://api.github.com/repos/kean/Nuke/issues/174","repository_url":"https://api.github.com/repos/kean/Nuke","labels_url":"https://api.github.com/repos/kean/Nuke/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/kean/Nuke/issues/174/comments","events_url":"https://api.github.com/repos/kean/Nuke/issues/174/events","html_url":"https://github.com/kean/Nuke/issues/174","id":338435140,"node_id":"MDU6SXNzdWUzMzg0MzUxNDA=","number":174,"title":"UITableViewCell image mix-up","user":{"login":"michaelnisi","id":108903,"node_id":"MDQ6VXNlcjEwODkwMw==","avatar_url":"https://avatars3.githubusercontent.com/u/108903?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelnisi","html_url":"https://github.com/michaelnisi","followers_url":"https://api.github.com/users/michaelnisi/followers","following_url":"https://api.github.com/users/michaelnisi/following{/other_user}","gists_url":"https://api.github.com/users/michaelnisi/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelnisi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelnisi/subscriptions","organizations_url":"https://api.github.com/users/michaelnisi/orgs","repos_url":"https://api.github.com/users/michaelnisi/repos","events_url":"https://api.github.com/users/michaelnisi/events{/privacy}","received_events_url":"https://api.github.com/users/michaelnisi/received_events","type":"User","site_admin":false},"labels":[{"id":185679380,"node_id":"MDU6TGFiZWwxODU2NzkzODA=","url":"https://api.github.com/repos/kean/Nuke/labels/bug","name":"bug","color":"b60205","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/kean/Nuke/milestones/18","html_url":"https://github.com/kean/Nuke/milestone/18","labels_url":"https://api.github.com/repos/kean/Nuke/milestones/18/labels","id":3702925,"node_id":"MDk6TWlsZXN0b25lMzcwMjkyNQ==","number":18,"title":"7.4.2","description":null,"creator":{"login":"kean","id":1567433,"node_id":"MDQ6VXNlcjE1Njc0MzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1567433?v=4","gravatar_id":"","url":"https://api.github.com/users/kean","html_url":"https://github.com/kean","followers_url":"https://api.github.com/users/kean/followers","following_url":"https://api.github.com/users/kean/following{/other_user}","gists_url":"https://api.github.com/users/kean/gists{/gist_id}","starred_url":"https://api.github.com/users/kean/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kean/subscriptions","organizations_url":"https://api.github.com/users/kean/orgs","repos_url":"https://api.github.com/users/kean/repos","events_url":"https://api.github.com/users/kean/events{/privacy}","received_events_url":"https://api.github.com/users/kean/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2018-10-01T17:26:02Z","updated_at":"2018-10-01T19:14:44Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2018-07-05T05:52:48Z","updated_at":"2018-10-01T19:14:44Z","closed_at":"2018-10-01T19:14:44Z","author_association":"CONTRIBUTOR","body":"Looks like I’ve found an interesting edge case, provoking Nuke to load the wrong image into a table view cell.\r\n\r\n![img_1237](https://user-images.githubusercontent.com/108903/42304168-2acbba74-8025-11e8-893c-8b42b37216ed.jpg)\r\n\r\nThe loading code, called from within the table view cell, does nothing special really:\r\n\r\n```swift\r\n  private static func load(\r\n    url: URL,\r\n    into view: UIImageView?,\r\n    sized size: CGSize,\r\n    cb: @escaping ImageTask.Completion\r\n  ) {\r\n    let req = ImageRequest(\r\n      url: url,\r\n      targetSize: size,\r\n      contentMode: .aspectFill\r\n    ).processed(with: ScaledWithRoundedCorners(size: size))\r\n\r\n    guard let v = view else { return }\r\n\r\n    os_log(\"loading image: %{public}@ %{public}@\", log: log, type: .debug,\r\n           url as CVarArg, size as CVarArg)\r\n\r\n    guard let currentImage = v.image else {\r\n      Nuke.loadImage(with: req, into: v, completion: cb)\r\n      return\r\n    }\r\n\r\n    os_log(\"placeholding with current image\", log: log, type: .debug)\r\n\r\n    let opts = ImageLoadingOptions(\r\n      placeholder: currentImage,\r\n      transition: nil,\r\n      failureImage: currentImage,\r\n      failureImageTransition: nil,\r\n      contentModes: nil\r\n    )\r\n\r\n    Nuke.loadImage(with: req, options: opts, into: v, completion: cb)\r\n  }\r\n```\r\n\r\nIt’s solid for all use cases, except for one. Erratically, **after state restoration in landscape mode**, my table view appears with mixed up images. Scrolling, of course, fixes the problem immediately.\r\n\r\nMy pipeline mainly uses defaults:\r\n\r\n```swift\r\n  init() {\r\n    let pipeline = ImagePipeline {\r\n      $0.imageCache = ImageCache.shared\r\n      \r\n      let config = URLSessionConfiguration.default\r\n      config.urlCache = nil\r\n      $0.dataLoader = DataLoader(configuration: config)\r\n      \r\n      $0.dataCache = try! DataCache(name: \"ink.codes.podest.images\") { name in\r\n        return String(djb2Hash32(string: name))\r\n      }\r\n      \r\n      $0.dataLoadingQueue.maxConcurrentOperationCount = 6\r\n      $0.imageDecodingQueue.maxConcurrentOperationCount = 1\r\n      $0.imageProcessingQueue.maxConcurrentOperationCount = 2\r\n\r\n      $0.isDeduplicationEnabled = true\r\n\r\n      $0.isProgressiveDecodingEnabled = false\r\n    }\r\n\r\n    ImagePipeline.shared = pipeline\r\n  }\r\n```\r\n\r\nThis isn’t a show stopper really, because of its rare appearance, but I find it fascinating and would love to dig in. I don’t have much time, but I can reproduce it quite reliably at the moment. Where would you look first?\r\n\r\n\r\n"}}
{"actor":{"display_login":"kean"}}