Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the GraphQL failed (SQL permission issue), the file remains orphan on disk #36

Open
niolap opened this issue Feb 26, 2024 · 0 comments

Comments

@niolap
Copy link

niolap commented Feb 26, 2024

Currently, the logic is the following (as described here https://github.com/graphile-contrib/postgraphile-plugin-upload-field/blob/master/README.md):

  1. Upload file on disk
  2. Insert/update row in the column table (SQL command)

The issue is that if the SQL command fails, the file stays on disk and is orphan.
As I manage my user permission via PostgreSQL RLS, if a user wants to insert 1000 files with no permission on the table, then I will have 1000 Oephan files on disk.

How could we prevent this?

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

No branches or pull requests

1 participant