Stream: dev

Topic: Tech debt: Orphaned objects in S3 on file removal(https://gi


view this post on Zulip Janvi Kapoor (Sep 17 2026 at 18:03):

Hi @Cheng Shi, @Philip Durbin, and team :wave:

Starting this thread to discuss issue #1073 (https://github.com/IQSS/dataverse-frontend/issues/1073).

Context: While reviewing the file upload flow in UploadedFilesList.tsx, I noticed a couple of TODO comments:

TypeScript

// TODO - Remove the file from the S3 bucket we need an API endpoint for this.

Currently, when files are directly uploaded to S3 and a user later clicks "Remove" (X) or "Remove Selected" from the staging list before saving the dataset, the files are cleared from the frontend form state, but the uploaded objects remain orphaned in the S3 bucket.

Discussion Points:

  1. Should we introduce a backend endpoint in core Dataverse to explicitly delete/abort uncommitted direct upload items?

  2. Or is the intended architecture to rely on S3 lifecycle rules / bucket expiration policies for unreferenced/temp objects?

Would love to hear your thoughts on how we should approach this!

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 15:38):

We just talked about this during the frontend meeting and I wanted to at least point out this API endpoint: https://guides.dataverse.org/en/6.12/api/native-api.html#cleanup-storage-of-a-dataset

That endpoint is a way to cleanup orphaned files that were uploaded but never attached to a dataset in a database sense.

view this post on Zulip Janvi Kapoor (Sep 24 2026 at 17:35):

@Philip Durbin ๐Ÿš€ Thanks for pointing this out, That makes a lot of sense., Given that api/datasets/{id}/cleanStorage handles sweeping orphaned S3 objects that were never finalized in the database, does the team prefer:, 1. Leaving cleanup entirely to this backend mechanism (and updating/removing the inline TODOs in UploadedFilesList.tsx and FileUploaderPanel.tsx with a reference to this behavior), or, 2. Adding a lightweight, immediate file-level deletion call on the frontend when the user clicks 'Remove' during draft staging?, Happy to adjust the TODO comments or open a PR documenting/handling whichever pattern fits the architecture best!

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 18:50):

Hi! First, I wanted to reproduce the bug myself and I just did, leaving a comment here: https://github.com/IQSS/dataverse-frontend/issues/1073#issuecomment-5820169072

I think I like your option 2, that clicking "remove" should remove the file from S3. See also my comment where I clicked "cancel". That should probably be handled too.

view this post on Zulip Janvi Kapoor (Sep 24 2026 at 19:21):

Thanks @Philip Durbin ๐Ÿš€ Seeing the LocalStack output makes the issue super clear. Handling both the staged "Remove" action and the page-level "Cancel" button makes complete sense for Option 2.

I just left a follow-up comment on issue exploring whether core Dataverse can issue presigned DELETE tokens for direct uploads or if a dedicated backend endpoint would be needed.

Looking forward to hearing what the team thinks, and I'd love to implement the frontend handling for this once we lock down the backend approach!

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 19:26):

I just read your comment in the issue. I don't know anything about presigned DELETE tokens. For now, do you want to try to get a delete working in LocalStack? Maybe we'll learn something. :smile:

view this post on Zulip Janvi Kapoor (Sep 24 2026 at 19:33):

Thanks for the suggestion, @Philip Durbin ๐Ÿš€

Currently, my local machine is pretty constrained on disk space and resources, so spinning up the full LocalStack and Dataverse backend Docker containers locally isn't feasible for me right now.

I'm very comfortable handling the React/TypeScript changes once the target delete mechanism or API pattern is established. In the meantime, I'll continue focusing on frontend bug fixes, hook refactoring, and test coverage across dataverse-frontend

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 19:35):

Sure, no problem. @Parth karalkar was having the same problem. Dataverse is too fat to run on his local machine. :piglet:

Good to know that you can still do React/TS changes though! :tada:

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 19:50):

No, we don't. Can we move that message to its own Zulip topic? Otherwise it's a little buried in this one.

view this post on Zulip Janvi Kapoor (Sep 24 2026 at 19:52):

No worries, I deleted the message to keep this thread focused on the issue!

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 24 2026 at 19:54):

Oh, no worries. It's a good question! :smile: Please feel free to start a new topic in #community or #dev even though you know the answer. :smile:

view this post on Zulip Oliver Bertuch (Sep 24 2026 at 22:02):

@Philip Durbin ๐Ÿš€ reading this it makes me wonder if JerseyTests would help with this as well. Maybe spinning up an S3 container is fine, but otherwise not having to deploy all of it just to test an isolated API for file storage would be great, wouldn't it?

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 25 2026 at 14:00):

Well, the SPA only supports S3. So developers need an S3 service to work on the app.

view this post on Zulip Philip Durbin ๐Ÿš€ (Sep 28 2026 at 14:11):

I just made https://github.com/IQSS/dataverse-frontend/pull/1089 where I'm explaining how to use the S3 file store from the backend dev env.


Last updated: Nov 02 2026 at 07:01 UTC