amplitude / Amplitude-Kotlin

Amplitude Kotlin SDK
MIT License
27 stars 10 forks source link

fix: thread-safe Identify object #124

Closed falconandy closed 1 year ago

falconandy commented 1 year ago

Summary

I tried to reproduce ConcurrentModificationExceptions bug. The exception is reproduced if some Identify object is shared and modified between identify calls. Current Identify implementation is not thread-safe.

Now I added synchronized access to mutation methods (clearAll, setUserProperty) and properties cloning (2 top levels). Not sure if the fix helps in all cases (including ConcurrentModificationExceptions bug).

Checklist

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.9.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: