Skip to content

fix: add status and created_at fields to file upload response#6094

Merged
vitormattos merged 4 commits intomainfrom
fix/return-right-fields-when-save-a-new-file
Dec 11, 2025
Merged

fix: add status and created_at fields to file upload response#6094
vitormattos merged 4 commits intomainfrom
fix/return-right-fields-when-save-a-new-file

Conversation

@vitormattos
Copy link
Copy Markdown
Member

Return status, statusText and created_at in the API response after file upload to display immediately in the files list without needing to reload. Also removed unused etag, path and type fields.

Uses FileMapper to get status text and returns FileEntity directly from save() method instead of additional database query.

Return status, statusText and created_at in the API response after
file upload to display immediately in the files list without needing
to reload. Also removed unused etag, path and type fields.

Uses FileMapper to get status text and returns FileEntity directly
from save() method instead of additional database query.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos added this to the Next Major (33) milestone Dec 11, 2025
@vitormattos vitormattos self-assigned this Dec 11, 2025
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 11, 2025
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable31

Update psalm type to reflect the actual fields returned by the
file upload endpoint: status, statusText, and created_at instead
of etag, path, and type.

Signed-off-by: Vitor Mattos <[email protected]>
Update OpenAPI spec and TypeScript types to reflect changes in
LibresignNextcloudFile response type with status, statusText, and
created_at fields.

Signed-off-by: Vitor Mattos <[email protected]>
Add FileStatus backed enum to provide compile-time type safety for file
status values. This replaces the previous int-based approach with a
proper enum that:

- Eliminates the need for default fallback in match expressions
- Provides IDE autocomplete for all valid status values
- Throws ValueError for invalid status codes instead of silently
  returning unknown status
- Accepts both int and FileStatus for backward compatibility

Updated getTextOfStatus() to use FileStatus enum with automatic
conversion from int via FileStatus::from(). Removed null return type
as status column is NOT NULL in database, ensuring statusText is
always a string.

This improves code maintainability and prevents invalid status values
from being used throughout the codebase.

Signed-off-by: Vitor Mattos <[email protected]>
@vitormattos vitormattos merged commit e5d703c into main Dec 11, 2025
77 of 93 checks passed
@vitormattos vitormattos deleted the fix/return-right-fields-when-save-a-new-file branch December 11, 2025 14:28
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant