Skip to content

Conversation

@vazarkevych
Copy link
Collaborator

Problem

Users are facing the issue of a JsonDecodingException crash after updating to the 6.1.3 version when using the setAttributesSync function. The error shows concatenated JSON being read from the stickybucket cache.

Unexpected JSON token at offset 221: Expected EOF after parsing, but had { instead
JSON input: .....v3_iteration__4": "1" }{ "attributeName": "userId".....

Root cause

setAttributesSync and refreshStickyBucketService (triggered internally by feature fetching) both call refreshStickyBucketsSync concurrently without synchronization. The file-based CachingAndroid performs non-atomic -> delete -> create -> append, so concurrent read/write operations can produce corrupted JSON

Fix

  • Add Mutex to GBUtils file to synchronize all sticky bucket read/write operations refreshStickyBucketsSync and saveStickyBucketAssignment. This prevents concurrent access to cache files.

  • Remove manual Accept-Encoding header in GBNetworkDispatcherOkHttp and GBNetworkDispatcherKtor. They handle gzip decompression transparently by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant