Skip to content

[stable32] fix: add status and created_at fields to file upload response#6099

Merged
vitormattos merged 4 commits intostable32from
backport/6094/stable32
Dec 11, 2025
Merged

[stable32] fix: add status and created_at fields to file upload response#6099
vitormattos merged 4 commits intostable32from
backport/6094/stable32

Conversation

@backportbot-libresign
Copy link
Copy Markdown

Backport of PR #6094

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]>
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]>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap Dec 11, 2025
@backportbot-libresign backportbot-libresign Bot added this to the Next Patch (32) milestone Dec 11, 2025
@vitormattos vitormattos merged commit 6e36fc3 into stable32 Dec 11, 2025
52 of 58 checks passed
@vitormattos vitormattos deleted the backport/6094/stable32 branch December 11, 2025 14:37
@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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant