You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resetting a user avatar after uploading a custom avatar returns HTTP 500. The reset flow updates the user avatar value, but cleanup of the replaced public file calls the file-deletion event helper with the wrong arguments.
Upload a valid image through the current user avatar upload action.
Confirm the avatar file is stored and can be read by another authenticated Workspace user.
Invoke the current user avatar reset action.
Expected result
The action returns HTTP 200, restores the generated avatar URN, emits the file deletion events, and removes the replaced binary and JSON sidecar.
Actual result
The action returns HTTP 500 with:
TypeError: create_file_deleted_events() missing 2 required positional arguments: file_uuid and recipient_user_uuids
delete_workspace_avatar_file() passes the file object and recipient list, while create_file_deleted_events() expects project_id, stream_uuid, file_uuid, and recipient_user_uuids.
Verification
The existing integration scenario test_avatar_upload_is_public_to_authenticated_users_and_reset_removes_it reproduces the failure after the upload and cross-user authenticated download assertions succeed. The mismatched call is present on the current PR head and is independent of generic public-file upload handling.
Suggested fix
Pass the deleted file project ID, nullable stream UUID, file UUID, and recipient UUIDs to create_file_deleted_events(), then keep the existing storage cleanup and integration assertions.
Summary
Resetting a user avatar after uploading a custom avatar returns HTTP 500. The reset flow updates the user avatar value, but cleanup of the replaced public file calls the file-deletion event helper with the wrong arguments.
Steps to reproduce
Expected result
The action returns HTTP 200, restores the generated avatar URN, emits the file deletion events, and removes the replaced binary and JSON sidecar.
Actual result
The action returns HTTP 500 with:
delete_workspace_avatar_file()passes the file object and recipient list, whilecreate_file_deleted_events()expectsproject_id,stream_uuid,file_uuid, andrecipient_user_uuids.Verification
The existing integration scenario
test_avatar_upload_is_public_to_authenticated_users_and_reset_removes_itreproduces the failure after the upload and cross-user authenticated download assertions succeed. The mismatched call is present on the current PR head and is independent of generic public-file upload handling.Suggested fix
Pass the deleted file project ID, nullable stream UUID, file UUID, and recipient UUIDs to
create_file_deleted_events(), then keep the existing storage cleanup and integration assertions.