Repository navigation
feat(files): persist uploaded files and associate them with conversations (#42) - #319
Open
Hustler490 wants to merge 1 commit into
Open
Hustler490 wants to merge 1 commit into
Hustler490 wants to merge 1 commit into
Conversation
|
@Hustler490 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Hustler490
force-pushed
the
feat/42-persist-uploads
branch
from
October 4, 2026 15:58
589a0b2 to
9be7a2b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42.
What
Persists uploaded files on disk and records them in a new
filestable so they can be listed, downloaded, attached to a conversation, and re-analyzed later.Model + schema
UploadedFilemodel (app/models/uploaded_file.py, tablefiles):id, workspace_id, user_id, original_name, stored_name, size, content_type, created_atplus an optionalconversation_idassociation.e2d3c4b5a6f7_add_files_table.py(upgrade creates the table + indexes; downgrade drops it).tests/test_migrations.pyhead assertion updated to the new revision.Storage + validation (
app/services/uploads.py)UPLOAD_FOLDER(app/config.py; a throwaway temp dir in testing) with a randomstored_name./tools/analyzeallowlist and 200k-char cap (ALLOWED_EXTENSIONS/MAX_UPLOAD_CHARSare now defined once and shared).Routes (
/tools/files)POST /tools/filesupload,GET /tools/fileslist,GET /tools/files/<id>metadata,GET /tools/files/<id>/download,POST /tools/files/<id>/attach(associate with a conversation),POST /tools/files/<id>/reanalyze. All are owner-scoped (user_id == current_user.id) and 404 for other users.Tests (
tests/test_files_persistence.py)Upload (metadata + on-disk bytes), retrieval, download, attach, re-analyze, unsupported-type rejection, and owner-only access.
Acceptance criteria
filestable with the requested columns.UPLOAD_FOLDERwith random names and validated extensions./tools/analyzevalidation.