# User data exports do not expire after 48 hours

**URL:** https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048
**Category:** Bug
**Created:** [March 31, 2019, 10:53am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048 "2019-03-31T10:53:32Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [March 31, 2019, 10:53am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/1 "2019-03-31T10:53:32Z")

</div>

When you create an export of your user data, the notification message says

> The above download link will be valid for 48 hours.

However, that does not seem to be the case: the file can still be downloaded after 48 hours (verified here on Meta)

The `retain_hours` field in the `Upload` model does not seem to be actually used anywhere.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [March 31, 2019, 4:05pm UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/2 "2019-03-31T16:05:23Z")

</div>

Hmm any changes needed here @tgxworld?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 2, 2019, 6:59am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/4 "2019-04-02T06:59:57Z")

</div>

@techAPJ Can you have a look at this? The validity of user exports regressed in [FIX: create upload record for exported csv files · discourse/discourse@91bf10b · GitHub](https://github.com/discourse/discourse/commit/91bf10bd12291adddab3edab2d788050fd484d43) when the user exports were changed to be backed by uploads record. I was going to make a change to clean up user exports after 48 hours but saw a spec in the commit that says not to clean up user exports. The following method and a scheduled job to clean up the user exports isn’t working anymore because the exports are not in the custom `csv_exports` directory which we should probably clean up as well.

> <https://github.com/discourse/discourse/blob/d85240335bef8888faac9b93cd33b68f9c9ff2e3/app/models/user_export.rb#L4>

> [@RGJ](#):
>
> The `retain_hours` field in the `Upload` model does not seem to be actually used anywhere.

This seems to be intentional and was added way back in 2014. I’m not sure if we still need to support it? @sam

[https://github.com/discourse/discourse/commit/58eabb03e5d6283b25e9ddd4f070e32c65be43c3#diff-60328924b5c773b42aacabc0b5698af4](https://github.com/discourse/discourse/commit/58eabb03e5d6283b25e9ddd4f070e32c65be43c3#diff-60328924b5c773b42aacabc0b5698af4)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [April 2, 2019, 7:16am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/6 "2019-04-02T07:16:53Z")

</div>

Another thing I realized is that (it looks like) user data exports are served over the CDN if that is configured.  
That doesn’t seem like a good idea?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 2, 2019, 8:31am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/7 "2019-04-02T08:31:45Z")

</div>

I don’t see any particular reason to remove this, the api is still tested and should work, no?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 2, 2019, 8:42am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/8 "2019-04-02T08:42:14Z")

</div>

Yup the API still and can work but I just wasn’t sure if we required that feature anymore.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [April 3, 2019, 8:02am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/9 "2019-04-03T08:02:23Z")

</div>

Fixed via:

[https://github.com/discourse/discourse/commit/7b194743d7e10a425086d52c8e8ddd42ce1856f3](https://github.com/discourse/discourse/commit/7b194743d7e10a425086d52c8e8ddd42ce1856f3)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 6, 2019, 7:12am UTC](https://meta.discourse.org/t/user-data-exports-do-not-expire-after-48-hours/113048/10 "2019-04-06T07:12:06Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
