Skip to content

Investigate duplicate collection path segments in STUF file URLs #82

@ashleythedeveloper

Description

@ashleythedeveloper

When uploading documents via the STUF UI, files are being stored and exposed with duplicate collection path segments in their URLs. Specifically, the collection prefix is being applied twice somewhere in the upload flow. This results in object names like products/products/admin/file.json instead of the expected products/admin/file.json, and API URLs such as /api/files/products/products/admin/file.json, where products is the collection name and admin is the role.

Acceptance Criteria:

  • Reproduce the issue by uploading a document via the STUF UI.
  • Trace the upload flow to identify where the collection prefix is being added twice.
  • Confirm the expected object name and URL structure for uploaded files.
  • Implement a fix so the collection prefix is applied exactly once.
  • Verify that uploaded files are stored as {collection_name}/{role}/file.json and served at /api/files/{collection_name}/{role}/file.json.
  • Add or update tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions