You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
We are seeing that going to background does not update the attributes with revenuecat and also if you make a purchase the purchases are updated on the revenuecat dashboard but not the attributes. The workaround for now it's calling to syncAtttributesAndOfferings when the app is become active or when the purchase is done.
Environment
Platform: iOS
SDK version: 4.41.2
StoreKit version:
StoreKit 1
StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
OS version: 17.5
Xcode version: 15.2
Device and/or simulator:
Device
Simulator
Environment:
Sandbox
TestFight
Production
How widespread is the issue. Percentage of devices affected.
Debug logs that reproduce the issue. Complete logs with Purchases.logLevel = .verbose will help us debug this issue.
Even doing the sync the console log these warns:
ERROR: 😿‼️ Error when syncing subscriber attributes. Details: The operation couldn’t be completed. (RevenueCat.BackendError error 0.)
UserInfo: [:]
ERROR: 😿‼️ One or more of the attributes sent could not be saved. ["$mediaSource": "Media source cannot be modified."]
I can assure that media source is only set once, and the backend error well, I don't know why it's happening.
The text was updated successfully, but these errors were encountered:
Hey @jesus-mg-ios!
This looks expected - once attribution data is set for a subscriber, it can't be changed. This way attribution data can be associated with the original installation without getting overwritten. The error that you are seeing: "Media source cannot be modified." is letting you know that this attribute already exists for the user, so it's not preventing you from setting attributes but from modifying the previously set attribute any further. This applies to device identifiers as well. You can read more about this in our documentation here: https://www.revenuecat.com/docs/customers/customer-attributes#reserved-attributes
Thank you for your response, @kmurphy-rc. Perhaps I wasn't clear enough. It seems like RevenueCat might be removing attributes at certain points. I was thinking about the method mentioned here, specifically when and where it is called, and if it might be causing issues related to data races.
For example, if the data is being cleaned while another thread is still writing a new user ID, the old user ID might be written by mistake. Creating an actor to manage all read and write operations could potentially solve this hypothetical data race problem. Currently, the workaround is to force a sync, which results in the error you pointed out.
However, I've noticed that RevenueCat does not always sync attributes when the app is backgrounded or when a purchase is made. Syncing happens sporadically, and most of the time, without forcing a sync, it does not occur.
Describe the bug
We are seeing that going to background does not update the attributes with revenuecat and also if you make a purchase the purchases are updated on the revenuecat dashboard but not the attributes. The workaround for now it's calling to syncAtttributesAndOfferings when the app is become active or when the purchase is done.
usesStoreKit2IfAvailable(true)
)Purchases.logLevel = .verbose
will help us debug this issue.Even doing the sync the console log these warns:
I can assure that media source is only set once, and the backend error well, I don't know why it's happening.
The text was updated successfully, but these errors were encountered: