Skip to content

fix: load attachment images more reliably#448

Merged
achou11 merged 1 commit intomainfrom
447/observation-details-attachment-fallback-images
Dec 8, 2025
Merged

fix: load attachment images more reliably#448
achou11 merged 1 commit intomainfrom
447/observation-details-attachment-fallback-images

Conversation

@achou11
Copy link
Copy Markdown
Member

@achou11 achou11 commented Dec 8, 2025

Fixes #447

The following places have been updated as follows:

  1. Observations list: used to only render previews. Now we fallback to thumbnails if previews cannot be loaded.
  2. Observation details: used to only render originals. Now we fallback to previews if originals cannot be loaded, and then thumbnails if previews cannot be loaded.
  3. Observation attachment: used to only render originals. Now we render the variant that matches the variant param in the URL. Note that we DO NOT try to render other variants as fallbacks. We can consider doing that or redirecting to the relevant URLs if desired, but in most cases this won't be necessary since navigation links to this page are only available based on the presence of the relevant variant.

For all of these, I've also improved the error handling so that there are clearer logs in Sentry. Before, we'd get reports about the image load error event from SuspenseImage, which were not very informative e.g. title would be something like AsyncContextStack.withScope and message like Event (type=error) captured as exception. Now we provide a more semantic log e.g. Failed to load original image along with a payload about the attachment/blob that can be found in the Additional Data section on Sentry.

@achou11 achou11 force-pushed the 447/observation-details-attachment-fallback-images branch from 8eef22d to de091d0 Compare December 8, 2025 17:41
@achou11 achou11 merged commit 9d8d9b0 into main Dec 8, 2025
21 of 22 checks passed
@achou11 achou11 deleted the 447/observation-details-attachment-fallback-images branch December 8, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fall back to showing other variants of photo attachment if originals are not available

1 participant