Closed aherbig closed 1 year ago
Hi @aherbig can you load the avatar-loader package directly from the branch to see if the issue resolved? https://github.com/readyplayerme/rpm-unity-sdk-avatar-loader.git#feature/caching-update
Hey @srcnalt works perfectly. Thank you.
I also noticed why it caused trouble in our project.
We are using this code here to set up Newtonsoft.Json to parse everything in UTC timezone:
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { DateTimeZoneHandling = DateTimeZoneHandling.Utc, DateParseHandling = DateParseHandling.DateTime };
Maybe you want to include that in a new unit test to prevent any future issues.
Thank you so much for following up on that issue
Thank you for the suggestion, I will check this out!
Describe the bug Avatar Caching does not work properly.
Seems that the LastModified date from the MetadataDownloader is parsed from the Response-Header in a UTC Timezone via DateTime.Parse. The LastModified date from the local json is parsed via newtonsoft.json and puts out a different timezone.
Even though both times are "equal", the check inside the MetadataDownloader.IsUpdated will always return false because "metadata.LastModified == previousMetadata.LastModified" are always different due to the TimeZones of the DateTime objects being different.
To Reproduce Steps to reproduce the behavior:
Expected behavior Already downloaded Avatar should be reused
Additional context My computers local timezone is GMT+1. I can imagine the bug not presenting itself when testing on a device that uses GMT timezone