-
Notifications
You must be signed in to change notification settings - Fork 1
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
ADAPT-1837: Added guard code to avoid crashes on page previews. #195
Conversation
…arge numbers of components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @nplowman ! I've tested this locally and it works well. I was still able to make changes to individual cards, rearrange them etc without the page crashing. I have one question for you, is there a reason that you use !=
instead of !==
in the typeof story comparison?
No specific reason. I'm fine changing it to the more strict type comparison if that's preferable. |
Nah, it's fine the way it is. Thanks! |
LINTING IS COMING! I'm working through getting prettier and airbnb standards set up to take care of questions like whether or not to use strict comparisons or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question about how the uid eventually gets resolved but otherwise this seems to do the job.
I spent a bit of time trying to pin this down because it was bothering me as well. After running document.getElementsByClassName('ood-story-card') to validate the number of cards getting rendered, it looks like on the first time sb.on('input') is triggered, the count dropped from 50 down to 20ish. So the guard code is just preventing a hard crash. Cards that only have the UUID are just getting skipped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good but I am not getting an alert on https://app.storyblok.com/#!/me/spaces/78141/stories/0/0/24605778
Is this still the correct page to trigger this issue?
Yes, but it should only trigger if it receives an unresolved UUID for one of the stories. (It will also only trigger once in a session, unless you delete the cookie). If you try to edit one of the fields on the page, it should trigger it. If not, I'll take a closer look and see what is going on. |
Ah there it goes. I swear I did that already. Ok. GTG. |
READY FOR REVIEW
Summary
Review By (Date)
Criticality
Review Tasks
Setup tasks and/or behavior to test
Before Fix: Preview would crash, and eventually show an error message. (Something about "component" being undefined).
After Fix: Preview should update as expected.
Front End Validation
Backend / Functional Validation
Code
Code security
General
Affected Projects or Products
Associated Issues and/or People
Resources