question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We shouldn't trust Child Apps in Region — anything could happen ©

See original GitHub issue

What do you think about adding componentDidCatch method to <Region /> component?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:35 (31 by maintainers)

github_iconTop GitHub Comments

5reactions
mAiNiNfEcTiOncommented, Nov 24, 2017

This responsibility cannot be delegated to the app developer. It has to be contained under the core system.

In general, browsers act mostly in the same way when it comes to <script src="..."></script> tags.

<script src="vendors.js"></script>
<script src="a.js"></script>
<script src="b.js"></script>

Say that both a.js and b.js, depend on vendors.js (classical type of structure here)…

If a.js has an error, a.js execution stops, but doesn’t block from b.js to run. Vice-versa for b.js

But if by any case, the error happens at the top (vendors.js) because an app is trying to use a method available on the vendors that is not being properly used AND the errors not properly handled, we have a broken page.

Although that should be properly monitored, logged and/or notified to the FB app developer, it should not at any time be a blocker for the whole page. Breaking normal functionality because of a misuse of the FB app dev, it is a big no-no.

3reactions
markvinczecommented, Dec 4, 2017

@froskie, I think the idea is that we should both

  • surround the registerApp call with a try-catch to catch any errors during app registration.
  • implement componentDidCatch to handle any rendering errors.

The work already started in rwd to do this automatically for every app: https://bitbucket.org/xivart/rwd_cheaptickets_nl/pull-requests/5680/mp-223-fb-bundler-handle-errors-from-fb/diff With that in place we don’t have to do anything in the actual apps, and we’ll get a default implementation of componentDidCatch generated by default, which simply hides the app if its rendering throws an error. @fahad19 what’s left to be done in that PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The child safety problem on platforms is worse than we knew
A startling new report finds far more minors using Snap, Facebook, YouTube, and TikTok than we suspected — and they're having sexual ...
Read more >
Do Parental Controls undermine trust, kill creativity and stifle ...
Moreover, the path of using parental controls is difficult to sustain and may even inhibit the kind of exploration and freedom that promotes...
Read more >
Should You Track Your Teen's Location? - The New York Times
Location tracking can, without question, damage the connection between parent and teenager. Research shows that adolescents who believe their ...
Read more >
Internet safety for teenagers | Raising Children Network
Key points. Teenagers can come across content, contact, conduct and contract risks when they're online or using digital media.
Read more >
Teens and Privacy: Should I Spy on My Child?
You can say something like: “I'm not going to interfere with your privacy, because you're doing so well. I have no reason not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found