RocketChat / Rocket.Chat.Apps-engine

The Rocket.Chat Apps engine and definitions.
https://rocketchat.github.io/Rocket.Chat.Apps-engine/
MIT License
115 stars 118 forks source link

[BUG] Contextual bar elements always return wrong roomID for action handler #788

Open RyanbowZ opened 2 months ago

RyanbowZ commented 2 months ago

When adding an element (e.g. a button) on a contextual bar, it will set some Action IDs, and then the executeActionHandler is expected to handle the action when the element is triggered and process it according to that ID. But in code implementation, despite that element is triggered, the room id get by this handler is wrong, which is just the general room rather than the room that the contextual bar was in.

Current temporary solution: from @vipin.chaudhary and @zishan.ahmad When you open the contextual bar it's opening in correct room mean the action you are using to open the room get's the correct I'd but when you make a action handler it's getting the general room The fix for this one is when you do a action to open the contextual bar just store the roomId in persistence for each user. And when you need to perform an action use that stored room I'd to get the room info using room reader When you are done just remove the persistence.

scuciatto commented 2 months ago

Hello, @RyanbowZ. I believe this is not a bug on the apps-engine. Looks like the request of the ui.interaction is being sent without the rid param so, the apps-engine doing a findOne() that returns general.