Mathieu2301 / TradingView-API

📈 Get real-time stocks from TradingView
1.47k stars 332 forks source link

GetUser function error on notification count parsing #243

Open nepomucen-s opened 3 months ago

nepomucen-s commented 3 months ago

Hi, there are issues with the following lines. It seems that TradingView now returns an empty object {} instead of a 0 when there are no new notifications. Maybe an error on their side, or maybe they changed their API. At least that's how it works for me now.

If anybody has a problem with that, just remove the parsing and fixate it to 0 (unless you use this data ofc), like this:

notifications: {
  following: 0,
  user: 0
},

https://github.com/Mathieu2301/TradingView-API/blob/693f205282c716ed71b340b20b9c5e3e7398ed97/src/miscRequests.js#L415 https://github.com/Mathieu2301/TradingView-API/blob/693f205282c716ed71b340b20b9c5e3e7398ed97/src/miscRequests.js#L416

clins1994 commented 3 months ago

@nepomucen-s thanks for the report man. could you try running this to see if it fixes your issue? https://github.com/Mathieu2301/TradingView-API/pull/244

if you can provide the example response and screenshot of the successful test that'd be great

once we have that, we can merge the fix

clins1994 commented 2 months ago

merged the fix. thank you @nepomucen-s for reporting it. i will check how to release it. will keep you posted