Skip to content

Expect Canvas URIs May Not Resolve #431

@thehabes

Description

@thehabes

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)

  1. interfaces/transcription/index.js - Lines 683, 700
    updateTranscriptionImages() - Uses vault.get(canvasID, 'canvas') with no try/catch. Promise rejection will crash the function.

  2. 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)

  1. 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.

  2. 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.

  3. components/continue-working/index.js - Lines 175-198
    getProjectThumbnail() - No response validation on canvas fetch. Overly broad catch block silently falls back without logging.

  4. 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)

  1. components/simple-transcription/index.js - Lines 518-525
    updateTranscriptionImages() - Checks for falsy return from vault.get() but doesn't catch promise rejections.

  2. components/read-only-transcribe/index.js - Lines 412-435
    processCanvas() - Has try/catch for info.json fetch but silently ignores all errors.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions