You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the error I understand that I have the same time property for a few entries:
Assertion failed: data must be asc ordered by time, index=3, time=1727077163.929, prev time=1727077163.929;
I using data from the backend to get coin price history, approximately 400 items in the array.
Array item:
Error Assertion failed: data must be asc ordered by time, index=3, time=1727077163.929, prev time=1727077163.929;
Expected behavior:
It should work whenever BE response has unique entries in the array
Screenshots:
CodeSandbox/JSFiddle/etc link:
The text was updated successfully, but these errors were encountered:
Yaroslav-Bulavin
changed the title
Assertion failed: data must be asc ordered by time.
Assertion failed: data must be asc ordered by time. TIME DIPLICATES
Sep 23, 2024
I suspect that your findDuplicateDatesWithTime isn't correctly identifying duplicate timestamps. Any two items which have the same time value would be considered a duplicate even if everything else was different.
In your case, you code is checking if the timestamp values match but also check that the id values match. So perhaps try removing && y.id !== x.id and you'll find the duplicate values.
Lightweight Charts™ Version: ^4.2.0
Steps/code to reproduce:
From the error I understand that I have the same time property for a few entries:
Assertion failed: data must be asc ordered by time, index=3, time=1727077163.929, prev time=1727077163.929;
I using data from the backend to get coin price history, approximately 400 items in the array.
Array item:
I have an endpoint that saves data in storage:
I added console.log to find duplications in the response data.
The findDuplicateDatesWithTime function:
But it logs me empty array every time(No duplicates have been found). So BE response is valid.
This is how I use timestamp from the response:
The strangest thing is that sometimes it works without any errors after the page refresh, but sometimes it crashes.
Tech stack: react, vite, lightweight-charts, typescript, redux-toolkit
Actual behavior:
Error Assertion failed: data must be asc ordered by time, index=3, time=1727077163.929, prev time=1727077163.929;
Expected behavior:
It should work whenever BE response has unique entries in the array
Screenshots:
CodeSandbox/JSFiddle/etc link:
The text was updated successfully, but these errors were encountered: