Store filename#101
Conversation
There was a problem hiding this comment.
Pull request overview
This PR threads an explicit filename: keyword through the attachment/upload pipeline so storage backends (notably S3) can receive the original filename during uploads, enabling downstream metadata/header behavior that’s helpful when serving via a CDN.
Changes:
- Add
filename:propagation throughStorageTables::Blob.create_and_upload!,Blob#upload_without_unfurling, and attachable upload helpers. - Update one-attachment attach/upload flow to forward
filename:intoupload_without_unfurling. - Add tests asserting
service.uploadreceives the expectedfilename:for multiple attachable types, plus update devcontainer post-create setup.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/models/attached/one_test.rb | Adds assertions that service.upload receives filename: across attachable types and setter-based assignment. |
| lib/storage_tables/attachable/one.rb | Passes filename: through to the upload helper during attach. |
| lib/storage_tables/attachable/changes/helper.rb | Extends helper upload to accept/forward filename: into blob uploads. |
| lib/storage_tables/attachable/changes/create_one.rb | Passes filename: into Blob.create_and_upload! for supported attachables and hash inputs. |
| app/models/storage_tables/blob.rb | Extends create_and_upload!/upload_without_unfurling to accept and forward filename: to service.upload. |
| .devcontainer/devcontainer.json | Adjusts post-create command to ensure gems are installed and reset the test DB. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
71c25f0 to
d937b4c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d937b4c. Configure here.

Description:
In this PR we ensure the filename is always passed when uploading a file to S3. That way, the filename is stored in the metadata, which makes it easier to host the S3 bucket behind a CDN.
Note
Medium Risk
Changes the core blob/attach upload contract and S3 object metadata; behavior is well-tested but affects every upload path.
Overview
Upload paths now thread
filenamefrom attachables throughBlob#create_and_upload!,upload_without_unfurling, and attach helpers soservice.uploadreceives it for S3 metadata and Content-Disposition (including plain strings viaFilename.wrap).Downloader#opendefaults tempfile names usingrefactored_checksumso checksums with/and+stay safe. Coverage adds one/many attach and S3 upload tests.The devcontainer moves to
/app, arunneruser, updated postCreate (dotfiles, bundle, test DB reset), and extra editor extensions.Reviewed by Cursor Bugbot for commit 08a5934. Bugbot is set up for automated code reviews on this repo. Configure here.