# PullHotlinkedImages does not replace images again after post is edited

**URL:** <https://meta.discourse.org/t/pullhotlinkedimages-does-not-replace-images-again-after-post-is-edited/154184>\
**Category:** Bug\
**Created:** [8 juni 2020 om 13:33 UTC](https://meta.discourse.org/t/pullhotlinkedimages-does-not-replace-images-again-after-post-is-edited/154184 "2020-06-08T13:33:12Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [8 juni 2020 om 14:34 UTC](https://meta.discourse.org/t/pullhotlinkedimages-does-not-replace-images-again-after-post-is-edited/154184/4 "2020-06-08T14:34:22Z")

</div>

Perfect, thanks for the detailed summary! I think the problem is here:

> [@Arkshine](#):
>
> Later, the original author updated the Wordpress post, the Discourse topic got updated and the original images are back:

I managed to produce a failing test case for this. It seems we only do the URL replacement when the image is **first** downloaded. If we have already downloaded the image once, it won’t be replaced again.

This is a failing test which demonstrates the issue

[https://github.com/davidtaylorhq/discourse/blob/27ccf99d162005f82bf4d4e69f860cf78affcfcb/spec/jobs/pull\_hotlinked\_images\_spec.rb#L63-L80](https://github.com/davidtaylorhq/discourse/blob/27ccf99d162005f82bf4d4e69f860cf78affcfcb/spec/jobs/pull_hotlinked_images_spec.rb#L63-L80)

I will add it to my list to fix. I should be able to get to it in the next few weeks.

---

_[View the full topic](https://meta.discourse.org/t/pullhotlinkedimages-does-not-replace-images-again-after-post-is-edited/154184)._
