RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp

Home Page:https://www.npmjs.com/package/@embeddedchat/react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Starred & Pinned messages sidebars fetch APIs infinitely

JeffreytheCoder opened this issue · comments

Description:

Starred & Pinned messages sidebars fetch APIs infinitely, caused by a recent change in #525

Screenshot 2024-03-22 at 11 57 28 PM Screenshot 2024-03-22 at 11 57 49 PM

Steps to reproduce:

  1. Open starred or pinned message sidebar
  2. See the infinite calls in the "Network" tab of the inspection tool

Actual behavior:

sidebar-rerender

Expected behavior:

Only fetch API once when the sidebar is opened

Yep @JeffreytheCoder I'm aware of it i checked last night... are you fixing it, or should I, do it?
The thing is i wanted to make this realtime, so while the sidebar is opened, it should still fetch the pinned message as soon it happened, i'm looking for a way to achieve it without making infinite calls.

Edit: You already fixed it !, Thanks @JeffreytheCoder , but is there a way we can make this realtime ?

Maybe listening to Real-time Apis provided by RC for threads, pinned message and starred message using webhooks provided by RC SDK? Will it be possible ? @JeffreytheCoder