TradingView-API icon indicating copy to clipboard operation
TradingView-API copied to clipboard

GetUser function error on notification count parsing

Open nepomucen-s opened this issue 1 year ago • 2 comments

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

nepomucen-s avatar Jun 28 '24 09:06 nepomucen-s

@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 avatar Jun 28 '24 10:06 clins1994

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

clins1994 avatar Jul 18 '24 03:07 clins1994