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

[Bug]: Braze Authentication Error when app is on the background #260

Open
martin-mentormate opened this issue Jun 19, 2024 · 3 comments
Open
Labels

Comments

@martin-mentormate
Copy link

martin-mentormate commented Jun 19, 2024

Which Platforms?

Android

Which React Native Version?

0.73.4

Which @braze/react-native-sdk SDK version?

11.0.0

Repro Rate

50%

Steps To Reproduce

Example:

  1. Generate brazeToken
  2. import Braze from "@braze/react-native-sdk".
  3. Braze.enableSDK()
  4. Braze.addListener(Braze.Events.SDK_AUTHENTICATION_ERROR, authFailure => console.log(authFailure))
  5. Braze.changeUser(id, brazeToken)
  6. Braze.setSdkAuthenticationSignature(brazeToken)
  7. Braze.requestContentCardsRefresh()
  8. Run the app and leave it in the background
  9. After the brazeToken expires, braze error 22 is thrown

Expected Behavior

The Braze SDK doesn't log errors when the user is inactive.

Actual Incorrect Behavior

The Braze SDK detects when the token expires and logs errors even if we have already received all campaigns, have loaded the all content cards and user is inactive.

Verbose Logs

No response

Additional Information

This issue started to appear after we migrated 8.0.0 -> 9.2.0. Later we migrated to 11.0.0 (currently latest), but we are still experiencing the same errors.
There are no breaking changes mentioned for Android in the change log - https://www.braze.com/docs/developer_guide/platform_integration_guides/react_native/changelog.
It is also important to point out that we are not receiving errors on iOS.

@jerielng
Copy link
Collaborator

@martin-mentormate Could you send in some verbose logs to [email protected] to confirm if there are any issues with the request behavior? It sounds like expected behavior since the SDK was able to receive a valid auth error from the server.

@martin-mentormate
Copy link
Author

@jerielng - I don't think there are any issues with the request behaviour as we receive all campaigns and content cards correctly and the token really is expired in this case (we get braze error 22). It's just that something changed in the Android SDK and it started detecting the braze token expiration before we have an opportunity to refresh it. I believe this is unexpected as we have already fetched all campaigns/content cards from braze, we do not reinitialise the braze sdk and we fetch campaigns and content cards once.
Note: We are basically using the same implementation for iOS and Android, but only the latter is affected.

@jerielng
Copy link
Collaborator

Thanks for the additional info @martin-mentormate - our support team would be in the best position to help diagnose the behavior here and provide some next steps, so if you are able to send in some verbose logs and any relevant code snippets to that email mentioned above, we would be able to get a better idea of what's going on. Thanks!

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

No branches or pull requests

2 participants