OpenFn / lightning

OpenFn/Lightning ⚡️ is the newest version of the OpenFn DPG and provides a web UI to visually manage complex workflow automation projects.
https://openfn.github.io/lightning/
GNU Lesser General Public License v3.0
125 stars 34 forks source link

Scheduled deletion of users account does not work #2500

Open christad92 opened 1 week ago

christad92 commented 1 week ago

When user requests to delete their account, we have a grace period which is automatically set as the scheduled deletion date for the account. On the date, the account and every data associated with the account should be wiped off the database.

This does not work at the moment - see table below for a list of deleted accounts, the records are still on the database even after the deletion period has passed.

image

The expected behaviour here is that the account is deleted as well as owned projects and credentials.

taylordowns2000 commented 1 day ago

You may already know this (sorry if I'm off base!) but note that these won't be deleted if there is any associated history. (I think it explains this in the deletion notification email too!)

Since we don't enforce history retention limits, it's possible that these accounts will be preserved until all related activity history is purged, and they will only then be deleted.

midigofrank commented 1 day ago

@taylordowns2000 good point. I have checked and the only history being checked before deletion is run creation

I have been able to test this with demo data. viewer@openfn.org gets deleted, demo@openfn.org (which I used to create runs) doesn't.

midigofrank commented 1 day ago

I've confirmed with @christad92 that the listed users don't have runs associated with them. There were some audit_events though. Weirdly, in the dev db there is no fk constraint linking them to the users, therefore the users should just get deleted without any errors.

Also if there are such errors (you cant delete because it is linked in x), shouldn't they get reported to sentry? 🤔