Skip to content

Handle provider rename failures in UserfilesController (#1436)#1603

Open
AviJxn wants to merge 1 commit intoaces:masterfrom
AviJxn:fix/rename-validation-1436
Open

Handle provider rename failures in UserfilesController (#1436)#1603
AviJxn wants to merge 1 commit intoaces:masterfrom
AviJxn:fix/rename-validation-1436

Conversation

@AviJxn
Copy link
Contributor

@AviJxn AviJxn commented Mar 13, 2026

I have updated the "update" action in the "UserfilesController" to properly handle cases where a file rename fails on the backend. Previously, the system would log a success message even if the storage provider rejected the change (usually due to a name collision).

By wrapping the "provider_rename" call in a conditional check, the controller now captures these failures. If the rename does not go through, it populates the "@userfile.errors" array with a specific warning. This ensures the UI stays in sync with the actual storage state, suppressing the "Success" flash message and letting the user know exactly what went wrong. I have verified the logic using a mock test suite to simulate provider level rejections.

issues #1436

Screenshot 2026-03-13 192802

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant