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

Fix / crash when personal shelf data is not valid #659

Conversation

ChristiaanScheermeijer
Copy link
Collaborator

Description

This PR fixes two problems with the personal shelves (favorites & watch history) when we try to load an account with invalid data.

The first problem is that the web app crashes while validating the data. This is a bit to aggressive and can be prevented.

When a validation error occurs, it basically means we can't guarantee that the integrity or the origin of the data. So instead of overwriting the data, we now prevent saving the data so we don't accidentally reset the favorites or watch history list.

When this happens, the user isn't notified, but we log an error to the console. We can improve this in the future to show a message to the user in this scenario.

Copy link

github-actions bot commented Dec 5, 2024

Visit the preview URL for this PR (updated for commit aee1f36):

https://ottwebapp--pr659-fix-crash-when-favor-k0sk5b3n.web.app

(expires Sat, 04 Jan 2025 13:25:59 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529

Copy link
Collaborator

@langemike langemike left a comment

Choose a reason for hiding this comment

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

I haven't encountered this issue myself, yet. But your approach is solid and easy to understand. Nice improvement!

@ChristiaanScheermeijer ChristiaanScheermeijer merged commit 00e4725 into develop Dec 5, 2024
10 checks passed
@ChristiaanScheermeijer ChristiaanScheermeijer deleted the fix/crash-when-favorites-data-validation-fails branch December 5, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants