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]: Sending push notification to wrong user #258

Open
HoangDilo opened this issue Apr 24, 2024 · 1 comment
Open

[Bug]: Sending push notification to wrong user #258

HoangDilo opened this issue Apr 24, 2024 · 1 comment
Labels

Comments

@HoangDilo
Copy link

Which Platforms?

iOS

Which React Native Version?

0.73.5

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

9.0.0

Repro Rate

Really hight, especially after switching users

Steps To Reproduce

Example:

  1. import Braze from "@braze/react-native-sdk".
  2. Run the app
  3. //some logics for creating anonymous users (haven't logged in)
  4. const deviceId = DeviceInfo.getUniqueId();
  5. run: Braze.changeUser(anonymous_${deviceId})
  6. //set attributes of an anonymous user to Braze (both standard and custom attributes)
  7. //login first account, calling apis to get the UserId_1
  8. run: Braze.changeUser(UserId_1)
  9. //set attributes of an User to Braze (both standard and custom attributes)
  10. //Logout logic
  11. const anonymousId = AsyncStorage.getItem('anonymous_id') //get back the anonymous user id from storage
  12. //switch back to anonymous users and run: Braze.changeUser(anonymousId)
  13. //set attributes of an anonymous user to Braze (both standard and custom attributes)
  14. //Login with second account, calling apis to get the UserId_2
  15. run: Braze.changeUser(UserId_2)
  16. Creating test push notification, sending to the changed user

Expected Behavior

  • Receive the test push notification (correspoding with the current user that is logging in)
  • Seeing error message: "No matching token..." when trying to push the notification to UserIds not being used

Actual Incorrect Behavior

  • NOT receive the test push notification for the that is logging in.
  • Receive test push notification of OTHER user

Verbose Logs

No response

Additional Information

  • I have tried to debug this bug, even try to log the current userId from Braze (with Braze.getUserId) after each switching phase. The userId return is correct (receive correct logged in user Id and correct anonymous user id)
  • I also monitor the payload has been sent to Braze via sdk, and the user id sent to Braze is correct too
  • Until now, this bug only appears on IOS actual devices, after me switching the user many times
@HoangDilo HoangDilo added the bug label Apr 24, 2024
@hokstuff
Copy link
Collaborator

Hi @HoangDilo,

Can you contact support@braze.com with more information:

  • Please attach verbose logs when you are able to reproduce this issue
  • Are you able to reproduce this with actual campaign sends (instead of Test Sends)?
  • Can you repro this with our React Native sample app?
  • At times, it may take a little bit for APNs to send a push notification that is received on a device. It may help to try again after some time if you feel that the notifications take a long time to be received by the device
  • Add a link to this Github issue for reference

The Braze Support team should help with trying to reproduce this issue to diagnose the root cause.

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