Skip to content

Slash commands are passing the first command as an argument #1216

@wreiske

Description

@wreiske
  • Your Rocket.Chat Experimental app version: 1.20.0.11408
  • Your Rocket.Chat server version: 2.0.0
  • Device (or Simulator) you're running with: Note 10+ 5G

Screenshot_20190923-111317

This has been an open issue on the Apps engine since October of 2018 and affected the native apps as well. Notice the url above shows /webex at the end of the URL.

RocketChat/Rocket.Chat.Apps-engine#69
wreiske/Rocket.Chat.App-WebEx#1

When using "username" from the apps engine, it should use the actual username, not the user's fullname. Also, when no slash command arguments are provided, there shouldn't be any arguments in the slash command's "arguments".

https://github.com/wreiske/Rocket.Chat.App-WebEx/blob/cd2712b1e6c28d706af2006f3b8e75ba093f7c16/commands/WebExCommand.ts#L17-L23

The context.getArguments() shouldn't have anything in them if the slash command was ran without any arguments. For some reason on the RN version, the first argument is always the slash command that ran. This is different than the desktop app that has no arguments (which is how it should work!)

Expected behavior:
/webex run by itself should return 0 arguments
/webex wreiske should return 1 argument, 'wreiske'

Actual Behavior:
For some reason /webex in the RN app is showing /webex run by itself as the first argument when there should be none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions