The web application unexpectedly crashes when a user attempts to update their profile picture. This issue has been consistently reproduced across multiple browsers.
- Navigate to the application's website and log in with valid credentials.
- Click on the 'User Profile' section in the top right corner.
- Click on the 'Edit Profile' button.
- Select 'Change Profile Picture'.
- Choose an image from the file picker dialog.
- Click 'Save'.
The selected image should replace the current profile picture, and the user should receive a confirmation message stating "Profile picture updated successfully."
The web application crashes immediately after clicking 'Save', displaying a generic "500 Internal Server Error" page.
Fatal Exception: RuntimeError: Unable to process request {/user/updateProfile}: TypeError: Cannot read property 'length' of null at ProfileUpdateHandler.js:120
- Browser: Google Chrome 92.0, Mozilla Firefox 89.0, Safari 14.1
- OS: Windows 10, macOS Big Sur
- App Version: WebApp 3.4.2
Upon investigating the error logs and the codebase, I found that the root cause of the crash is due to the profile object being treated as a null string instead of a null array. This misconfiguration likely stems from the migration that occurred last night. The migration, by default, set the profile property to a null string rather than a null array, leading to the TypeError when attempting to read the 'length' property.
- The issue does not occur when updating other profile details, such as username or bio.
- Immediate attention to the migration scripts and default values is recommended to prevent similar issues in the future.