-
Notifications
You must be signed in to change notification settings - Fork 3
Description
All attempts to fetch a Canvas URI should have adequate error handling for when the Canvas does not resolve. This is typical of the internet and is to be expected. The app / interface / component should never hard crash in this scenario. We found 8 instances where hard failure occurs. Investigate for more instances and apply error catching and throwing as necessary. Be as consistent as possible with each instance where the canvas may not resolve. It seems like we are using vault inconsistently. Investigate whether we should refactor so that all instances incorporate vault or not.
Critical (Will Crash on Failure)
-
interfaces/transcription/index.js - Lines 683, 700
updateTranscriptionImages() - Uses vault.get(canvasID, 'canvas') with no try/catch. Promise rejection will crash the function. -
components/read-only-transcribe/index.js - Lines 345-360
loadAnnotations() - Direct fetch with no response validation or error handling. Will crash if fetch fails.
High (Inadequate Error Handling)
-
components/line-image/index.js - Lines 207-219
connectedCallback() - Fetches canvas URI without response.ok check. Only logs to console on error, no user feedback. -
interfaces/transcription/index.js - Lines 628-654
getImage() - Only handles 404 errors. Other HTTP errors (5xx, network timeouts) not handled. Shows fallback image without notifying user. -
components/continue-working/index.js - Lines 175-198
getProjectThumbnail() - No response validation on canvas fetch. Overly broad catch block silently falls back without logging. -
components/legacy-annotator/plain.js - Lines 399-406
loadCanvas() - Has response.ok check but just re-throws the error. Caller has no try/catch.
Medium (Partial Handling)
-
components/simple-transcription/index.js - Lines 518-525
updateTranscriptionImages() - Checks for falsy return from vault.get() but doesn't catch promise rejections. -
components/read-only-transcribe/index.js - Lines 412-435
processCanvas() - Has try/catch for info.json fetch but silently ignores all errors.