lookit / ember-lookit-frameplayer

Ember app with experiment frames and a frame player to run browser-based experiments
MIT License
5 stars 20 forks source link

Add error catching/logging for recording start and stop/upload problems #402

Closed becky-gilbert closed 5 days ago

becky-gilbert commented 4 months ago

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

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.

{
    "videoId": "consent-videoStream_5fc855b5-6d92-4f53-9404-ad251c30bb8f_0-video-consent_a72079fb-99cf-463f-9106-2eea240d0c8c_1721944527372_591",
    "eventType": "exp-lookit-video-consent:uploadComplete",
    "timestamp": "2024-07-25T21:55:39.328Z",
    "streamTime": null
}

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.

{
    "videoId": "consent-videoStream_5fc855b5-6d92-4f53-9404-ad251c30bb8f_0-video-consent_fabe522e-ff4e-42b3-8cc9-1d8c4d8934be_1721945400049_935",
    "eventType": "exp-lookit-video-consent:recordingUploadTimedout",
    "timestamp": "2024-07-25T22:10:12.568Z",
    "streamTime": null
},

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.

{
    "error": "Error: Error: Error completing upload: Error: Upload part failed after 3 attempts.\nError: NoSuchUpload: The specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.",
    "videoId": "consent-videoStream_5fc855b5-6d92-4f53-9404-ad251c30bb8f_0-video-consent_ff75dbda-0963-404a-a39b-aec576e8b82d_1722034788775_747",
    "eventType": "exp-lookit-video-consent:errorStoppingRecorder",
    "timestamp": "2024-07-26T22:59:57.034Z",
    "streamTime": null
},