From 1d026c3d30bba3fde9205ddf93493d284908b1b9 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Fri, 6 Feb 2026 18:44:14 +0530 Subject: [PATCH] fix(16-01): add S3 404 error handling with toast notification - Add react-toastify import for toast notifications - Show toast.error('File no longer available') when attachment fetch fails - Handles S3 404 errors gracefully per REQ-5.5 - Replaces silent failure with user-friendly error message --- jam-ui/src/components/client/chat/JKChatMessage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jam-ui/src/components/client/chat/JKChatMessage.js b/jam-ui/src/components/client/chat/JKChatMessage.js index c60558403..46d558d1c 100644 --- a/jam-ui/src/components/client/chat/JKChatMessage.js +++ b/jam-ui/src/components/client/chat/JKChatMessage.js @@ -1,5 +1,6 @@ import React, { useCallback, useState } from 'react'; import PropTypes from 'prop-types'; +import { toast } from 'react-toastify'; import { formatTimestamp } from '../../../utils/formatTimestamp'; import { formatFileSize } from '../../../services/attachmentValidation'; import { getMusicNotationUrl } from '../../../helpers/rest'; @@ -63,7 +64,8 @@ const JKChatMessage = ({ message }) => { } } catch (error) { console.error('Failed to fetch attachment URL:', error); - // Could show toast error here, but keep it simple for now + // Show user-friendly error (REQ-5.5) + toast.error('File no longer available'); } finally { setIsLoadingUrl(false); }