fix(errors): surface previously-silent async failures (DP1/DP4/DP6)
Several fire-and-forget promises failed silently: - RoomInput slash-command exe() rejections reset the editor as if they succeeded; now caught and shown via an error toast. - Favourite / low-priority room-tag toggles (setRoomTag/deleteRoomTag) swallowed rejections; now surfaced via the same error toast. - Call-decline sendEvent(RTCDecline) was uncaught; now logged best-effort while the local UI still dismisses. Adds a shared createErrorToast builder mirroring createDownloadToast. /kick and /ban route through rateLimitedActions, whose to() helper swallows non-429 errors, so those two can still resolve on failure — noted in code; the top-level exe() catch covers everything that does reject. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -544,11 +544,16 @@ function IncomingCallListener({ callEmbed, joined }: IncomingCallListenerProps)
|
||||
|
||||
const handleReject = useCallback(
|
||||
(room: Room, eventId: string) => {
|
||||
// Best-effort: the local UI dismisses regardless (below), but a failed
|
||||
// decline used to reject uncaught. Log it instead of surfacing — the caller
|
||||
// will time the call out on their side even if our decline never lands.
|
||||
mx.sendEvent(room.roomId, EventType.RTCDecline, {
|
||||
'm.relates_to': {
|
||||
rel_type: RelationType.Reference,
|
||||
event_id: eventId,
|
||||
},
|
||||
}).catch((err) => {
|
||||
console.error('Failed to send call decline:', err);
|
||||
});
|
||||
setCallInfo(undefined);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user