Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Comments

SBH upload endpoints#24

Merged
Gonza10V merged 7 commits intomainfrom
sbh_fj_upload
Nov 19, 2025
Merged

SBH upload endpoints#24
Gonza10V merged 7 commits intomainfrom
sbh_fj_upload

Conversation

@supersonik12
Copy link
Collaborator

  • uploadResource endpoint complete
  • can upload to SBH and add attachments
  • uploadExperiment endpoint partially complete, FJ upload still in progress

@Gonza10V
Copy link
Collaborator

@codex review this code

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 81 to 83
if 'Attachments' in files and 'attachments' in params_from_request:
attachment_files = files.getlist("Attachments")
attachments = {params_from_request['attachments'][file.filename] : file for file in attachment_files}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard against missing attachment metadata

When attachments are present, attachments is built with params_from_request['attachments'][file.filename] for every uploaded file. If the client uploads a file without a matching entry in the attachments metadata (or the metadata is malformed), this indexing raises a KeyError and the request returns a 500 instead of a 4xx validation error. The previous implementation had no attachment handling and therefore didn’t expose this crash path. Consider validating that each uploaded file has a corresponding metadata entry and returning a user error when it doesn’t.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fair enough, make a proposal to implement your suggestion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex I created the environment, try to implement your suggestion now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Added validation to ensure uploaded attachments have corresponding metadata and return clear 400 responses when metadata is missing or malformed. sbs_server/app/views.pyL80-L118

Testing

  • ⚠️ Tests not run (not requested)

View task →

@Gonza10V Gonza10V merged commit be3daf4 into main Nov 19, 2025
1 check passed
@Gonza10V Gonza10V deleted the sbh_fj_upload branch November 19, 2025 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants