-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: use property syntax all the properties that are persisted #114
base: develop
Are you sure you want to change the base?
feat: use property syntax all the properties that are persisted #114
Conversation
SDK persists `userId`, `anonymousId` and `traits`. In future, we are not going to persist the `externalId`. Therefore, I omitted that.
Previously, only messageBatchMap was getting cleared.
…property-syntax-in-useridentity-members
* val anonymousId = analyticsInstance.anonymousId | ||
* ``` | ||
*/ | ||
var Analytics.anonymousId: String? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that when we have extension property like this, we are unable to access getter and setter for this field in a java class making it java incompatible. We have to define them as class level property in this case.
|
||
val anonymousId = analytics.anonymousId | ||
|
||
assertTrue(anonymousId == CUSTOM_ANONYMOUS_ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: we can use assertEquals
instead of assertTrue at some places.
…Analytics class This is to make it Java interoperable.
Description
userId
,traits
, andanonymousId
, that persist in storage (excludingexternalId
as in future we are going to remove its persistence). Also, we've added a setter to set only theanonymousId
.Type of change
Implementation Details
identify
event. I've not provided the option to get theexternalId
, as we've decided to remove the persistence for this value in future PR.UserIdentity
class itself, where those variables have been defined.Checklist
How to test?
anonymousId
:userId
andtraits
:Breaking Changes
getAnonymousId
andsetAnonymousId
APIs defined in the Analytics class. Now, the user needs to access this as a property. Now, this is no longer valid:Maintainers Checklist
Screenshots (if applicable)
Before:
After:
Additional Context
NOTE: We've not added getters for externalId, as we've planned to remove storage support for that property.