RocketChat / RocketChat/Rocket.Chat
Unexpected behaviour of the "room-opened" event in iFrames
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
We are planning on using the "room-opened" event to notify the parent window of our website in case the user selects a room from the sidebar. The first time you select a specific room, the event triggers, but on every subsequent selection of a previously opened room, the event only triggers when closing the room or when selecting a room you have previously not opened.
Steps to reproduce:
- Select room x from the sidebar inside a Rocket.Chat iFrame => Event is fired.
- Select another room y => Event is fired.
- Select room x again => Event is not fired here.
- Now when you select room y again, the "room-opened" event is fired, but with the event data of room x instead of y.
Expected behavior:
I would expect the room-opened event to fire every time you select a room from the sidebar and show the event data of the selected room.
Actual behavior:
Selecting a previously opened room only triggers when closing the room. In case you open room x twice and then open a room that has not been opened before (after the latest browser refresh), you will neither get notified of room x opening nor closing.
Is this the intended behaviour? To my understanding, the room-opened event should trigger every time you open a room regardless of if it was open before from the time the last browser refresh happened.
Server Setup Information:
- Version of Rocket.Chat Server: 6.4.2
- Operating System: linux
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Enabled
- NodeJS Version: 14.21.3 - x64
- MongoDB Version: 7.0.2
Client Setup Information
- Desktop App or Browser Version: Browser Version
- Operating System: affects any operating system
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the room-selection sequence in a browser using the Rocket.Chat iFrame and observe the “room-opened” event payload for previously opened rooms. Compare each selection with the expected behavior: the event should fire every time a sidebar room is selected and report the selected room’s data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100