-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add error catching/logging for recording start and stop/upload problems #402
Open
becky-gilbert
wants to merge
19
commits into
develop
Choose a base branch
from
log-s3-upload-problems
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ess, and to specific set-up/stop events
…mprove errors for Sentry logging
…start/stop, improve errors for Sentry logging
… any in-progress video recordings
…wait, add upload part promises to chain to catch errors
…d in promise chain and catch/log all errors
…to help with error logging; remove unnecessary _stopPromise
6 tasks
bleonar5
approved these changes
Jul 30, 2024
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.
I haven't tested this, but it looks great and seems like a really rational improvement. Great work!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #395 (but should not automatically close that issue).
This PR adds logging about upload problems to the experiment data, so that researchers have some indication of why a video isn't listed in a given response, and improves our Sentry logging for uploading problems.
Explanation of changes
async
/await
andthen
/catch
promise chains for consistency and to improve error catching. Previously, some promises wereawaited
but not part of the returned promise chain, so any problems related to those promises were not being caught. Now, all of the necessary steps for starting and stopping/uploading will be in the same promise chain that is returned from the functions, which makes it easer to catch/log errors that occur during the whole chain of events.video-recorder
should always throw an error so that the error propagates to the video/session recording mixins, where it can be logged in the data. In many cases the video/session recording mixins will also throw an error, but sometimes not (e.g. if the stop recording promise was rejected because of an upload timeout, then we just want to log that event and continue as normal).New events logged in the data:
Examples
Here's what things look like in the experiment data. If this PR is approved then I will add all of this info to the researcher documentation.
Upload successful
If the "uploadComplete" event is logged for a particular file, then that file should be available for the researcher to download. If the researcher does not see the video file in the Responses pages, then they should contact us so that we can investigate.
Upload timed out
If the "recordingUploadTimedout" event is logged for a particular file, then that file might or might not be available for the researcher to download. If the researcher does not see the video file in the Responses pages after 24 hours, then there was probably a problem with the participant's internet connection during the study session.
Error stopping/uploading
If the "errorStoppingRecorder" event is logged for a particular file, then that file failed to save and will not be available for the researcher to download. This error could be due to problems with our S3 settings/credentials, existing file name in S3 for this upload, in-progress upload that was completed/aborted too soon, etc. This type of error is unlikely to occur but I've included it in the researcher data to allow us to easily identify or rule out missing videos that might be caused by these problems.