Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing userfiles more gracefully #12454

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

snipe
Copy link
Owner

@snipe snipe commented Feb 2, 2023

Previously, if an uploaded user file (not avatar, but uploaded via the "Files" tab on the user page) was missing from the server, the entire user page would crash. This change handles it a bit more gracefully and does not 500.

While this scenario shouldn't happen, it could, if a file was manually deleted, or if some files were lost.

Fixes RB-16844.

Screenshot 2023-02-02 at 10 50 11 AM

@what-the-diff
Copy link

what-the-diff bot commented Feb 2, 2023

  • Added a new translation string for file_not_found
  • Updated the view to show an icon if the file is not found, and added some logic around checking whether or not it's an image before displaying anything at all.

Copy link
Collaborator

@marcusmoore marcusmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without actually testing myself (😅) this looks good to me 😄

Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems just a bit cleaner; looks good to me. Nice fix. I would've probably gotten lazy around the 'file not found' stuff, your way is going to be nice and clean.

@snipe snipe merged commit 2d3318f into develop Feb 2, 2023
@snipe snipe deleted the fixes/fixed_500_when_userfile_does_not_exisy branch February 2, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants