-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Description
Description:
Two avatar upload components have incomplete error handling:
- RoomAvatarEditor: Missing FileReader.onerror handler, causing silent failures when file reading errors occur
- UserAvatarEditor: Missing error message when image format validation fails
Users receive no feedback when avatar uploads fail, leading to confusion.
Steps to reproduce:
Bug 1: RoomAvatarEditor - Missing FileReader Error Handling
- Go to any room → Room Info → Edit
- Open Browser DevTools Console (F12)
- Try Simulated FileReader failure (I have tested locally)
- Click "Upload" in Room Avatar section
- Select any image file
- Observe: No error message appears (Console shows "BUG: No onerror handler!")
Bug 2: UserAvatarEditor - Missing Format Validation Error
- Go to http://localhost:3000/account/profile
- Click "Upload" button
- Select a non-image file (e.g., .txt file)
- Observe: No error message appears, avatar doesn't change
Expected behavior:
- Error toast messages should appear when:
- FileReader fails (corrupted files, too large, permission errors)
- Image format validation fails (non-image files, invalid formats)
- Users should receive clear feedback about upload failures
Actual behavior:
- RoomAvatarEditor: No error message when FileReader fails
- UserAvatarEditor: No error message when format validation fails
- Both components fail silently, leaving users confused
Server Setup Information:
- Version of Rocket.Chat Server: develop
- License Type: Community
- Operating System: windows 11
- Deployment Method: Development (meteor)
Client Setup Information
- Desktop App or Browser Version: Chrome
- Operating System: Windows 11
Additional context
Solution:
- Use existing
readFileAsDataURLutility (has proper error handling) - Add error messages for format validation failures
- Ensure both components handle all error scenarios
Relevant logs:
Browser Console:
FileReader error occurred but NO onerror handler is registered!
BUG: No onerror handler!
coderabbitai
Metadata
Metadata
Assignees
Labels
No labels