fix(presigned-url): match files→buckets by table name prefix instead of schema name#1075
Merged
pyramation merged 1 commit intomainfrom May 8, 2026
Merged
Conversation
…of schema name Schema-name matching is ambiguous when multiple storage modules share the same PG schema (e.g. app_files + data_room_files both in storage_public). This caused data_room_files to match app_buckets (first hit), so UploadDataRoomFileInput was missing the ownerId field. Fix: derive the prefix from the raw SQL table name: data_room_files → prefix 'data_room' → matches data_room_buckets app_files → prefix 'app' → matches app_buckets
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Fixes the file-upload mutation generator's files→buckets codec matching logic. The previous implementation matched by PostgreSQL schema name (
extensions.pg.schemaName), which is ambiguous when multiple storage modules share the same schema. In that case,.find()returns the first bucket codec (e.g.app_buckets) for all file codecs, causing entity-scoped input types likeUploadDataRoomFileInputto be missingownerId.The fix derives a prefix from the raw SQL table name (
extensions.pg.name) by stripping the_files/_bucketssuffix, then matches on that prefix:data_room_files→ prefixdata_room→ matchesdata_room_buckets✓app_files→ prefixapp→ matchesapp_buckets✓Discovered via CI failure on constructive-db#1054:
Field "ownerId" is not defined by type "UploadDataRoomFileInput".Review & Testing Checklist for Human
<prefix>_files/<prefix>_bucketsconvention. Verify this holds for all current and planned storage modules. If a table name doesn't end with_filesor_buckets, thereplace()is a no-op and the full name becomes the prefix — could silently skip or mismatch.minio-multi-scope.integration.test.tssuite in constructive-db to confirm entity-scoped uploads (ownerIdinUploadDataRoomFileInput) work end-to-end.extensions.pg.nameis somehow undefined, bothfilesPrefixandbucketPrefixwould beundefined, causing a false match (undefined === undefined). Low risk since PostGraphile always populates this, but worth noting.Notes
storageBucketsloop) is not affected because bucket entry points iterate over bucket codecs directly — no cross-codec matching needed there.s3-signer.integration.test.ts. The real validation is the constructive-db integration test.Link to Devin session: https://app.devin.ai/sessions/7903d2a3e7a34c6daa605e12d6b80d9e
Requested by: @pyramation