Skip to content

Conversation

@Santosh69
Copy link
Contributor

@Santosh69 Santosh69 commented Dec 31, 2025

Fixes #1187

Summary

Added secure file deletion and real-time size fetching to the backend, the backend code now lives in its own dedicated
storage.js module

Checklist

Backend (Secure Storage)

  • Secure Deletion: deleteMediaFile ensures strict ownership validation before deletion.
  • Metadata: getFileMetadata fetches real file sizes dynamically.

Additional Notes

  1. Testing Proposal: Should we add Unit Tests for this new backend logic in a follow-up PR?
  2. Delete Strategy: Implements a "File-Only Delete" strategy (removes physical file to save costs, but preserves the Firestore record to prevent accidental metadata/note loss).
  3. Commit Structure: I intentionally made the previous commits follow here, for you to separately test the frontend and backend part

Future Work

This PR updates the Storage Page with real data. The Dashboard Widget still uses mock data, should I update that here or in a separate PR?

Part of #1188

@Santosh69
Copy link
Contributor Author

Hiii @marcgc21 , could you review this.. happy to make any changes or reverts of the Additional notes

@marcgc21
Copy link
Member

marcgc21 commented Jan 2, 2026

@KarinePistili I'm worried about this part:

Delete Strategy: Implements a "File-Only Delete" strategy (removes physical file to save costs, but preserves the Firestore record to prevent accidental metadata/note loss).

In theory if for some reason, we delete the file, it shouldn't be removed from the firestore also? I'm trying to think a way in which we wouldn't like to remove it but I can't find it.

Any idea?

@marcgc21 marcgc21 self-assigned this Jan 2, 2026
@Santosh69
Copy link
Contributor Author

Santosh69 commented Jan 2, 2026

yeah @marcgc21 felt exactly the same that is why I added as note, because the files might appear when we refresh (sometimes) , but when clicked would show error and not found etc..

we can make change to handle this, Instead of deleting the record, we could Nullify the link.

@Santosh69
Copy link
Contributor Author

also lmk if you have thoughts on unit tests and dashboard's mock data..

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: new module called "Storage"

2 participants