Skip to content

[HIGH] Group message send failure silently discards the typed message #454

Description

@KruGoL

Summary

GroupChatModule.sendMessage in the SDK never throws on publish failure — it catches and returns null (verified in the installed SDK: logger.error("GroupChat", "Failed to send message", error); return null). The mutation wraps it as return !!message, so it resolves with false instead of rejecting; onSuccess runs unconditionally and clears the input (setMessageInput('')), and the global mutation onError toast never fires. The user's typed group message is gone with zero feedback.

Where

src/components/chat/hooks/useGroupChat.ts:367.

Fix (app-side, immediate)

In mutationFn: if (!message) throw new Error('Failed to send message') so the global onError toast fires and onSuccess (input clearing) is skipped. Apply the same guard to the mini-chat/DM send flows and to deleteMessage/kickUser/createGroup (all fail silently today).

Companion SDK improvement (optional)

The proper upstream fix is for GroupChatModule.sendMessage (and the moderation methods) to surface failures — throw, or return a typed { ok: false, error } — instead of swallowing them and returning null. Tracked separately in the SDK repo.

Found by multi-agent audit @ main b477d4d; adversarially verified.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions