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

bug: StatusUpdateForm throwing error using modifyActivityData prop to add "to" target users. #352

Open Rushu-geek opened 2 years ago

Rushu-geek commented 2 years ago

Describe the bug

I am using getstream in react-native application. To add feed activities I am using react-native component "StatusUpdateForm" where I want to target users so that the activity should also display in those targeted user's feed. I looked for way to implement it and after searching on so much time on internet I got some reference to do it. We can add modifyActivityData prop and add "to" properties to add target user ids. Here is my code

<StatusUpdateForm
    feedGroup='rowing'
    modifyActivityData={
        (data:any) => ({
            ...data,  
            to:['rowing:123']
        })
    }
/>

After I add activity and hit submit button I am getting following error. [Error: {"detail":"You do not have permission to do this, you got this error because there are no policies allowing this request on this application. Please consult the documentation https://getstream.io/docs/","status_code":403,"code":17,"exception":"NotAllowedException","duration":"0.17ms","more_info":"https://getstream.io/docs/api_error_responses"} with HTTP status code 403]

To Reproduce

Steps to reproduce the behavior:

  1. Add status update form in stream app.
  2. Use modifyActivityData prop and add "to" property with target user id.
  3. Add activity data and hit on submit button.

Expected behavior The post should be successfully added and It should also reflect in the targetted user's feed.

Screenshots image

Desktop (please complete the following information):

HenMoshe commented 2 years ago

Hey Rushu! First nice app idea! Its not a bug- you cant modify another user feed with default permissions. Check permissions docs for an explanation on how to change permissions