Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/add-forward-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Add detailed error messages to forwarding failures.
11 changes: 6 additions & 5 deletions src/app/components/message/modals/MessageForward.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function MessageForwardInternal({
const [isTargetSelected, setIsTargetSelected] = useState(false);
const [isForwardSuccess, setIsForwardSuccess] = useState(false);
const [isForwarding, setIsForwarding] = useState(false);
const [isForwardError, setIsForwardError] = useState(false);
const [forwardError, setForwardError] = useState<string | null>(null);
const [targetRoomId, setTargetRoomId] = useState<string | null>(null);

// detect if it's a public room or not
Expand Down Expand Up @@ -285,15 +285,16 @@ export function MessageForwardInternal({
setIsForwardSuccess(true);
})
.catch((err: unknown) => {
const message = err instanceof Error ? err.message : String(err);
debugLog.error('ui', 'Message forward failed', {
sourceRoomId: room.roomId,
targetRoomId: targetRoom.roomId,
error: err instanceof Error ? err.message : String(err),
error: message,
});
Sentry.metrics.count('sable.message.forward.error', 1);
setIsForwarding(false);
setIsForwardSuccess(false);
setIsForwardError(true);
setForwardError(message);
});
};

Expand Down Expand Up @@ -348,9 +349,9 @@ export function MessageForwardInternal({
<Text>Forward to {getRoom(targetRoomId)?.name}</Text>
</Button>
)}
{isForwardError && (
{forwardError && (
<Text size="T300" color="Critical600" style={{ margin: config.space.S300 }}>
Failed to forward message. Please try again.
Failed to forward: {forwardError}
</Text>
)}
</Box>
Expand Down
Loading