Open johnjmikucki opened 1 year ago
@johnjmikucki Check #187 , and download my fork, as I don't know if they will merge it and get it updated. I implemented the fix in #65 as @LiYuanBr suggested. Hope it helps. Here is my fixed version: https://github.com/PatalJunior/ewelink-api/tree/origin/master
Opening this as a new issue on the package b/c the issue with the proximally-failing code is closed. (See discussed-not-committed) patch suggested by @LiYuanBR (https://github.com/LiYuanBr) at https://github.com/skydiver/ewelink-api/issues/65#issuecomment-1226180143. Their reconnection attempt in the catch block can ITSELF fail (in my case b/c DNS server failed), and when it does any exceptions are unhandled.
I've exactly zero javascript experience, so I'm loathe to propose an implementation, but think the wssLoginPayload() call needs to be wrapped in its own try-catch block which simply logs the exception and retries. I'm happy to help further diagnose / test proposed patches. If my fooling around with it produces something potentially useful, I'll post it here.