GetStream / react-activity-feed

Stream React Activity Feed Components
https://getstream.io/react-activity-feed/
BSD 3-Clause "New" or "Revised" License
136 stars 83 forks source link

FlatFeed real-time notification not working #90

Open brunoluiz opened 4 years ago

brunoluiz commented 4 years ago

We are using the following code for one of our flat feeds. It doesn't seem to be receiving data from our web socket, as it never renders the Notifier component when we push new activities to the stream.

import 'react-activity-feed/dist/index.es.css';
import { StreamApp, FlatFeed } from 'react-activity-feed';
import React from 'react';
import ReactDOM from 'react-dom';

const API_KEY = "...";
const APP_ID = "...";
const TOKEN = "...";

const App = () => <StreamApp apiKey={API_KEY} appId={APP_ID} token={TOKEN} >
  <FlatFeed 
    notify
    feedGroup="STREAM_XYZ"
    Activity={(props) => <pre>{JSON.stringify(props)}</pre>}
  />
</StreamApp>;

ReactDOM.render(<App />, document.getElementById('root'));

Dependencies:

  ...
  "dependencies": {
    "react": "^16.12.0",
    "react-activity-feed": "^0.9.26",
    "react-dom": "^16.12.0",
    "react-scripts": "3.4.0"
  }

Am I missing something on this setup?

jaapbakker88 commented 4 years ago

Do you see the messages in the console saying "now listening for realtime...."

Can you add the userId prop to the FlatFeed component.

rkulinski commented 3 years ago

I'm having the same issue. I do see now listening to changes in realtime for.... Passing userId didn't help.

On the backend I'm doing removeActivity and the feed is not updated until I refresh the page. It seems like removeActivity for some reason is not notyfing Feed.

Using 0.10.4.

jaapbakker88 commented 3 years ago

yeah it's not live updating for removeActivity, only on new activities(which wil show the "you have X new activities" banner). For others you wil have to refresh, which is intended behaviour.

rkulinski commented 3 years ago

@jaapbakker88 how should I know "in browser" when activity was deleted on server (let's say another user deleted it)?

augustosamame commented 3 years ago

We also have this issue. After spending weeks setting up a full fledged integration with getstream.io, we find that the feed is not updated for removeActivity, which renders our whole integration useless. Not sure why this would be "intended behaviour", but since it is, there needs to be a way for the component to detect the change in the feed data and trigger the refresh.

augustosamame commented 3 years ago

Since getstream people seem to be unresponsive, here's what we did to solve this issue. Whenever an activity is deleted, there is actually a websocket communication sent:

image

You can listen for this data stream and reload the component to show the updated feed.

Hope this helps someone that has the same issue we did. Shame on getstream for their non-existing support even for paid accounts.

Rykuno commented 3 years ago

I'm running into this issue as well. When a user's page isnt cached within NextJS it listens for new changes, but navigating back to a subsequent user's feed after caching it does not trigger. I was hoping there would be a manual way to go about this.

vuthanhtrung0504 commented 1 year ago

Are there any update on this yet? I'm also have this isssue