Skip to content

Comments

#253/Items that have been uploaded more than 6 months before should be automatically deleted#413

Open
idelinz wants to merge 1 commit intoenBloc-org:devfrom
idelinz:#253-old-items-cleanup
Open

#253/Items that have been uploaded more than 6 months before should be automatically deleted#413
idelinz wants to merge 1 commit intoenBloc-org:devfrom
idelinz:#253-old-items-cleanup

Conversation

@idelinz
Copy link

@idelinz idelinz commented Mar 24, 2025

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review on my code
  • I have made corresponding changes to the documentation (if any were needed)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and previously existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Description

Relates #253

  • Added pg_cron extension
  • Created a recurring cron job to remove items older than 6 months based on the created_at field

This PR does not resolve questions:

  • what happens if an item has been available for more than 6 months but there are active conversations relating to this issue?
  • should the donor receive a notification that their item will be deleted if it is not given away soon ?
    how would we notify them of this?

Files changed

20250324015132_add-pg_cron-job-to-delete-old-items - added new migration

Tests

Not sure is it possible or needed

@netlify
Copy link

netlify bot commented Mar 24, 2025

👷 Deploy request for cool-creponne-3e1272 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2d57021

Copy link
Contributor

@ShaughnAnderson94 ShaughnAnderson94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool I knew that there was built in chron jobs in supabase but have only done them elsewhere. So onto the non-resolved questions I am curious if you have some solutions in mind. I thought about it for a bit and for messages we could make it also check that there are no messages related to the item sent in the last 3 months. As for notifying the users I think it might be easiest to just notify them it has been deleted and they can reupload if they really think someone would want it. we could just have them be emailed when it is deleted. I have not used the built into supabase chron jobs but when on other projects I have just put a route into the next api the sends emails when its triggered by the chron job and something like that could probably be done here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants