-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Setup (always fill this in):
- iOS or Android?
- Both
- Expo or regular React Native?
- Regular
- React Native Version: 0.64.1
react-native-activity-feedversion: 1.1.0
Describe the bug
I have users logging in/out. When the token changes when someone logs in (due to different user identifier), I get an 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.15ms","more_info":"https://getstream.io/docs/api_error_responses"} with HTTP status code 403]
I believe this is because the StreamApp component does not re-render its inner contents (or something) when the token changes, so it tries to fetch the feed using the old token. Or something?
To Reproduce
Steps to reproduce the behavior:
- Fetch a token for a user. Store it in state and pass it to the StreamApp component.
- Render a feed for the current user ID.
- Change the user ID (log out, then log in with another account, or simply change the user ID).
- Fetch a new token for that new ID. Do not reload the app.
- See that the feed does not rerender the whole component (or something) and you get the error.
Expected behavior
When the token changes, the component re-renders.