Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shubhamcommits/e636dd54777b8289c3feae955855cbf1 to your computer and use it in GitHub Desktop.
Save shubhamcommits/e636dd54777b8289c3feae955855cbf1 to your computer and use it in GitHub Desktop.
StickerMule: Unexpected Web Application Crash on User Profile Update

Issue Title: Unexpected Web Application Crash on User Profile Update

Description:

The web application unexpectedly crashes when a user attempts to update their profile picture. This issue has been consistently reproduced across multiple browsers.

Steps to Reproduce:

  1. Navigate to the application's website and log in with valid credentials.
  2. Click on the 'User Profile' section in the top right corner.
  3. Click on the 'Edit Profile' button.
  4. Select 'Change Profile Picture'.
  5. Choose an image from the file picker dialog.
  6. Click 'Save'.

Expected Behavior:

The selected image should replace the current profile picture, and the user should receive a confirmation message stating "Profile picture updated successfully."

Actual Behavior:

The web application crashes immediately after clicking 'Save', displaying a generic "500 Internal Server Error" page.

Error Log Extract:

Fatal Exception: RuntimeError: Unable to process request {/user/updateProfile}: TypeError: Cannot read property 'length' of null at ProfileUpdateHandler.js:120

Environment:

  • Browser: Google Chrome 92.0, Mozilla Firefox 89.0, Safari 14.1
  • OS: Windows 10, macOS Big Sur
  • App Version: WebApp 3.4.2

Analysis:

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.

Additional Notes:

  1. The issue does not occur when updating other profile details, such as username or bio.
  2. Immediate attention to the migration scripts and default values is recommended to prevent similar issues in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment