Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] SendMessageDisallowedIndicator is missing when user doesn't have capability to send message in channel (regression) #2747

Closed
8 tasks
speakeasy-chat-app opened this issue Nov 1, 2024 · 2 comments

Comments

@speakeasy-chat-app
Copy link

Issue

When a user isn't allowed to send a message, the SendMessageDisallowedIndicator is no longer showing. Instead the user is presented with a MessageInput, and can enter a message, only to get the following error in console logs: StreamChat error code 17: SendMessage failed with error

This seems to be a regression from the changes here (line 1060 of MessageInput.tsx.)
eb4ae4c#diff-86dc374aab4800be48d530a2bc910453ba27e3e5a23c15bd04538c6262cac9eaR1060

It works on 5.34 and is broken on 5.40. The change #2598 above went out in 5.35.

Steps to reproduce

Steps to reproduce the behavior:

  1. Go to a channel where the user does not have permissions to send a message
  2. See that a MessageInput box appears and you can type a message in the client and click send
  3. Error occurs in the console on sending (and the message shows up with a red exclamation mark error)

Expected behavior

  1. Go to a channel where the user does not have permissions to send a message
  2. See the SendMessageDisallowedIndicator component show up instead of MessageInput

Project Related Information

Customization

Click To Expand

# N/A

Offline support

  • I have enabled offline support.
  • The feature I'm having does not occur when offline support is disabled. (stripe out if not applicable)

Environment

Click To Expand

package.json:

# N/A

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • stream-chat-react-native version you're using that has this issue:
    • e.g. 5.4.3
  • Device/Emulator info:
    • I am using a physical device
    • OS version: e.g. Android 10
    • Device/Emulator: e.g. iPhone 11

Additional context

Screenshots

Click To Expand


@speakeasy-chat-app
Copy link
Author

In 5.34, the code in MessageInput.tsx was

  if ((disabled || !ownCapabilities.sendMessage) && SendMessageDisallowedIndicator) {
    return <SendMessageDisallowedIndicator />;
  }

In 5.35, instead of

  if (!editing && disabled && !ownCapabilities.sendMessage && SendMessageDisallowedIndicator) {
    return <SendMessageDisallowedIndicator />;
  }

It probably should be

  if ((!editing || disabled || !ownCapabilities.sendMessage) && SendMessageDisallowedIndicator) {
    return <SendMessageDisallowedIndicator />;
  }

@isekovanic
Copy link
Contributor

Hi @speakeasy-chat-app , thanks a lot for the very detailed report ! There's a PR open that should fix this, you'll be let know via this GH issue whenever it gets merged and deployed in a version.

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

No branches or pull requests

2 participants