-
-
Notifications
You must be signed in to change notification settings - Fork 63
feat(remix): add connection check to example page #967
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
feat(remix): add connection check to example page #967
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #967 +/- ##
=======================================
Coverage 24.28% 24.28%
=======================================
Files 121 121
Lines 12883 12883
Branches 715 715
=======================================
Hits 3128 3128
Misses 9734 9734
Partials 21 21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/remix/sdk-example.ts
Outdated
setIsConnected(result !== 'sentry-unreachable'); | ||
} | ||
checkConnectivity(); | ||
}, []); |
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.
l: let's avoid potential eslint warnings about empty useEffect
arrays
}, []); | |
}, [setIsConnected]); |
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.
Btw some context here (we discussed this offline already, but just if someone is interested): The set...
functions have a stable reference so they won't cause useEffect
to fire again. However, it's advised to always include all potential variables to the dependency array.
React docs about set...
and stable identities: https://react.dev/reference/react/useState#setstate-caveats
diagnoseSdkConnectivity()
function to programmatically detect possible connectivity issues sentry-javascript#15821Before:

After:
