Skip to content

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

@raquelmsmith

Description

@raquelmsmith

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions