A discussion on the expiration of user data exports revealed that the notification message stating the download link will be valid for 48 hours is incorrect. RGJ found that the file can still be downloaded after 48 hours. The retain_hours field in the Upload model is not used anywhere.
The issue is due to a regression introduced in this commit when user exports were changed to be backed by uploads record. tgxworld explained that the method to clean up user exports after 48 hours is not working because the exports are not in the custom csv_exports directory.
It was also noted that user data exports are served over the CDN if configured, which may not be a good idea. sam suggested that the API still works and should not be removed. The issue has been fixed by techAPJ via this commit.
@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 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.
This seems to be intentional and was added way back in 2014. I’m not sure if we still need to support it? @sam