Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When token changes, component does not re-render #265

Open
raquelmsmith opened this issue Feb 24, 2022 · 0 comments
Open

When token changes, component does not re-render #265

raquelmsmith opened this issue Feb 24, 2022 · 0 comments

Comments

@raquelmsmith
Copy link

Setup (always fill this in):

  • iOS or Android?
    • Both
  • Expo or regular React Native?
    • Regular
  • React Native Version: 0.64.1
  • react-native-activity-feed version: 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:

  1. Fetch a token for a user. Store it in state and pass it to the StreamApp component.
  2. Render a feed for the current user ID.
  3. Change the user ID (log out, then log in with another account, or simply change the user ID).
  4. Fetch a new token for that new ID. Do not reload the app.
  5. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant