-
Notifications
You must be signed in to change notification settings - Fork 3
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 network errors #661
Conversation
I'm still trying to think of a good way to validate this will send an error to Sentry on prod - but, per the doc, if the Sentry integration picks up on JS errors, this should accomplish that. |
}, | ||
method: "POST", | ||
|
||
try { |
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.
@lilidworkin - thank you for exploring this and coming up with this solution!
Pull Request Test Coverage Report for Build 13533022774Details
💛 - Coveralls |
We could deploy a version of this that throws an error to staging and test that way - I was playing around on the staging URL and was able to send an error through. Not ideal, but could validate this. |
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.
Thank you @mxosman, appreciate this !! Looks exactly like what I had in mind. I think it's okay to assume this works for now, not sure it's worth the effort of trying to figure out how to test.
Rather than making it the oncall responsibilty to check Sentry (which feels annoying given how infrequently we expect errors to happen here) @mxosman maybe you and I can just turn our Sentry alerts on for that project -- I was able to do that here: |
Sounds great, Lili! Great call! I just turned on alerts for Sentry as well - thanks for the screenshot. |
Thanks so much @mxosman ! If you can deploy this to prod when you get a chance, that would be great. |
For sure! I was already on my way to do that and poked around in staging and noticed a strange crash happening unrelated to our work: It's not happening in prod though, so it might be that the backend deploy is out of sync in staging. I wanted to do a deploy of the api to staging, but realize I don't have the updated env files - do you know where I can get those variables? |
I'll deploy this to prod in the meantime, but thought it was worth resolving just to be extra safe. I think likely what happened was at some point both the backend and frontend were deployed directly to prod, and an updated version of the backend wasn't deployed to staging. When I deployed my previous changes, they were purely FE only, so I didn't need to deploy the backend. This change should be fine to go directly to prod and I'll double check just to be safe/roll back if it shows the same crash. |
Ok sounds good, thank you for noticing this and looking into it! You should be able to get the env variables from 1password in public-dashboard-untracked-config-files.zip, do you see them there? |
OK - prod deploy was a success! No issues. :)
I don't see that zip file. I only have my private vault and the Justice Counts vault. I do see a March 7, 2022 spotlight-staging-config-files.zip in the JC vault - but, I imagine it might be stale by now. Would you mind sharing yours with me? If you right click on it > click Share > Share and check "Can be viewed only 1 time" - it should be safe for me to access. Maybe via DM when Slack is back up and running? |
Yes, will email you! |
Quick update on the staging deploy of the backend: I'm still waiting to figure out permissions w/ Peter to be able to deploy via |
@mxosman weren't you able to deploy Spotlight before? What changed? |
Not the backend. The previous changes I made were purely FE so there was no need to deploy the BE. Deploying the BE involves using Google Cloud with the following command: |
Oh got it! Why do we need to deploy the backend? This PR only touches the FE? |
This is to fix the unrelated crash that was going on in staging I mentioned before, just to keep things sync'd up. It makes it harder to test in staging with the crash, which I think is coming because the backend is out-of-sync in staging, but sync'd up in prod (my hunch anyway). Not super critical, but threw me for a loop when I was trying to test this in staging. |
Description of the change
Handle network errors by wrapping the
fetchMetrics
function in a try-catch. This should throw a JS error which will hopefully be caught by our Sentry integration.Type of change
Related issues
Checklists
Development
These boxes should be checked by the submitter prior to merging:
Code review
These boxes should be checked by reviewers prior to merging: