Analytics.Internal.BufferX.ClearBuffer causes an ArgumentException

After switching my project to the analytics 5.0.0 package I got the following crash from the CloudDiagnostic:

ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

Managed Stack Trace:

Managed Stack Trace:
System.Collections.Generic.List`1[T].RemoveRange (System.Int32 index, System.Int32 count) (at <9d9536d9127f4a489d989c7a566aee1c>:0)
Unity.Services.Analytics.Internal.BufferX.ClearBuffer (System.Int64 upTo) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
Unity.Services.Analytics.Internal.Dispatcher.UploadCompleted (System.Int64 responseCode) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
Unity.Services.Analytics.Internal.WebRequestHelper+<>c__DisplayClass2_0.<SendWebRequest>b__0 (UnityEngine.AsyncOperation <p0>) (at <cac68f5af87e4ffbb5b62c6b20719ad1>:0)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <aa8a130777a0452aba2a2ed77148f1da>:0)

Unfortunately, I cannot provide any more info on the context. Don’t know what the end-user did to cause this. Anyway the Bufffer class probably should include some sort of failsafe for this.

Hey there,

Thanks for this report. Our engineers were able to verify it and put in a bug fix for 5.0.1
That’s working it’s way through the release pipeline, and that would normally mean it’s availabe later this week.

There may be unforeseen delays with that, but hopefully all will be well and you’ll be able to carry on without this bug occurring.

Cheers!