RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
39.5k stars 10.12k forks source link

Previewer function is not notified of all keystroke events #32650

Open AmanNegi opened 3 weeks ago

AmanNegi commented 3 weeks ago

Description:

I am implementing the previewer function of the slash command. While reading the arguments available in the function, I noticed that the arguments are not updated/notified beyond a certain point.

Steps to reproduce:

  1. Generate a RC-App and create a class that implements the ISlashCommand.
  2. Implement the previewer function, and simply get the arguments using context.getArguments().
  3. Print the arguments to the console (or logs). You will be able to see the arguments instantaneously in the terminal thus I prefer to print to console. Print to console, only if you have a server running on your Local System/Docker.
  4. Upload the app to the RC server, and test your /command args.

Expected behavior:

The previewer function should be notified of all changes made to the text field, so that operations can be performed on the latest and intermediate changes.

Actual behavior:

Currently, as mentioned above the previewer function is not notified of all updates made to the text field, even when the user stops writing it doesn't get updated. Which is unexpected and reduces the possibilities of utilizing the previewer function.

Video Demonstration:

https://github.com/RocketChat/Rocket.Chat/assets/37607224/6e4312fe-8c9f-4f4d-8a4f-5f68c3a3f5a8

Server Setup Information:

Client Setup Information

Additional context

When I incurred this issue, I looked into other RC apps which utilized the previewer function and one of them was Apps.Giphy however upon testing it locally I was able to conclude it also faces similar issues.

reetp commented 3 weeks ago

Hi.

Thanks for reporting.

Can you test on the latest dev code please?

Thanks.

AmanNegi commented 3 weeks ago

Hey @reetp I tried it out on the develop branch 6.10.0-develop and it does face the same issue.

reetp commented 3 weeks ago

Ok thanks for testing.

I'll make sure someone is aware.

This may need moving to the apps engine repo but I'll check.

reetp commented 3 weeks ago

Ok someone will take a look..

No promises on a fix yet :-)