RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
745 stars 80 forks source link

Deleting a custom attribute from dashboard stops you from setting the same attribute in the future #1011

Closed khlling closed 3 months ago

khlling commented 4 months ago

Describe the bug I found this issue while testing custom attribute targeting.

  1. Set a custom attribute in code e.g. Purchases.setAttributes({ age: 24 }); syncAttributesAndOfferingsIfNeeded();
  2. Find the user in the Revenuecat portal and observe that the custom attribute is present
  3. Delete custom attribute from the user via the dashboard
  4. Try to set the custom attribute again in code (same as step 1)
  5. Observe the user's custom attributes - then custom attribute does not appear even after opening and closing the app
  6. I can however recreate the custom attribute from the dashboard and it correctly syncs to the frontend.

Through investigation, I have found a workaround:

Set the custom attribute to "" before setting it to the value you want:

Purchases.setAttributes({ age: "" }); 
Purchases.setAttributes({ age: 24 }); 
syncAttributesAndOfferingsIfNeeded();

I would expect that deleting the custom attribute from the backend means I can recreate from the frontend without issue. I am being careful to call syncAttributesAndOfferingsIfNeeded(); below the limit of 5 per minute whilst testing.

  1. Environment
    1. Platform: Android/iOS
    2. SDK version:
    3. OS version:
    4. Xcode/Android Studio version:
    5. React Native version: 0.70
    6. SDK installation (CocoaPods + version or manual):
    7. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context Add any other context about the problem here.

RCGitBot commented 4 months ago

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

HaleyRevcat commented 3 months ago

Hi, thanks for bringing this to our attention. Regarding how you are deleting the attribute and it isn't appearing, this might be related to our customer dashboard caching as when you go to set the attribute in the app it might not be cleared yet. Let me check this with the team and I will let you know.

mshmoustafa commented 3 months ago

Hi @khlling, Sorry for the late response. Is this happening when setting the subscriber attribute to be the exact same thing it was before you deleted it? What if you set Purchases.setAttributes({ age: 24 }); , delete via dashboard, and then set Purchases.setAttributes({ age: 100 });, do you still experience the same issue?

mshmoustafa commented 3 months ago

Hi @khlling, Since this issue hasn't been updated for some time, I closed it. But if you're still having this issue, please feel free to reopen it.