Describe the bug
I am encountering an issue where the connection appears to freeze after 30 pings. There are no apparent errors or events logged during this process. This behavior persists consistently. I have attempted to troubleshoot the issue, but so far, I have been unable to identify the root cause. Any assistance or guidance on resolving this issue would be greatly appreciated.
To Reproduce
import TradingView from '@mathieuc/tradingview'
const client = new TradingView.Client(); // Creates a websocket client
// événements du client
client.onError((...err) => { // Listen for errors (can avoid crash)
console.error('Client error:', ...err);
// Do something...
});
client.onLogged((...args) => {
console.error('Client logged:', ...args);
});
client.onPing((...args) => {
console.error('Client ping:', ...args);
});
client.onData((...args) => {
console.error('Client data:', ...args);
});
client.onEvent((...args) => {
console.error('Client event:', ...args);
});
client.onConnected((...args) => {
console.error('Client connected:', ...args);
});
client.onDisconnected((...args) => {
console.error('Client disconnected:', ...args);
});
const chart = new client.Session.Chart(); // Init a Chart session
chart.setMarket('OANDA:EURUSD', { // Set the market
timeframe: '1',
type: 'HeikinAshi',
});
chart.onError((...err) => { // Listen for errors (can avoid crash)
console.error('Chart error:', ...err);
// Do something...
});
chart.onSymbolLoaded(() => { // When the symbol is successfully loaded
console.log(`Market "${chart.infos.description}" loaded !`);
});
chart.onUpdate(() => { // When price changes
if (!chart.periods[0]) return;
// console.log(chart.infos)
// console.log(chart.periods.length)
console.log(`[${chart.infos.description}]: ${chart.periods[0].close} ${chart.infos.currency_id}`);
});
Describe the bug I am encountering an issue where the connection appears to freeze after 30 pings. There are no apparent errors or events logged during this process. This behavior persists consistently. I have attempted to troubleshoot the issue, but so far, I have been unable to identify the root cause. Any assistance or guidance on resolving this issue would be greatly appreciated.
To Reproduce
Expected behavior No freezing
Screenshots no
Environment:
Additional context Last logs :