tradingview/lightweight-charts-android

Cannot update oldest data

VictorKalevich opened this issue · 2 comments

java.lang.IllegalStateException: Error: Cannot update oldest data, last time=1633647540, new time=1633564800
at jsCode.DataLayer._internal_updateSeriesData(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:10536)
at jsCode.ChartApi._internal_updateData(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:11477)
at jsCode.SeriesApi.update(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:10889)
at jsCode.SeriesFunctionManager.findSeries(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:11925)
at jsCode.Object.functionRef(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:11896)
at jsCode.FunctionManager.call(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:11644)
at jsCode.MessagePort.port.onmessage(file:///android_asset/com/tradingview/lightweightcharts/scripts/app/main.js:12398)
Caused by: java.lang.IllegalStateException

please, consider don't throw exception, just warning

Hi! You can not update oldest bars. Also we can not send warnings because that will lead to undefined behavior. You should check data on your side. Anyway I will research possibility to catch async methods so you will be able to use try-catch

Created an issue with researching of using try-catch with api calls #112