check_win error
Traceback (most recent call last): File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\site-packages\BinaryOptionsToolsV2\pocketoption\asynchronous.py", line 356, in _get_trade_result trade = await self.client.check_win(id) asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 458, in wait_for fut.result() asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\site-packages\BinaryOptionsToolsV2\pocketoption\asynchronous.py", line 340, in check_win trade = await asyncio.wait_for(self._get_trade_result(id), timeout=timeout_seconds) File "C:\Users\Asus\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 460, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Project\BinaryOptionsTools-v2-master\examples\python\async\check_win.py", line 27, in
Hello!
Could you show us the relevant part of the code so that me, @Rick-29 and @sixtysixx can check this?
Thank you in advance.
That used from example check_win in python
I see, @Rick-29 could you help us with this?
I think i have a fix for that bug. i just recompiled the rust on my pc and it works returning the actual trade data.
So basically when a trade is placed, the deal result is sent from PocketOption as a binary WebSocket message, but the DealsApiModule in BinaryOptionsToolsV2 fails to parse it. This causes check_win() to timeout waiting for a result that was never delivered to the waiter. The library expects Socket.IO formatted messages (e.g., 42["updateOpenedDeals",...] or 451-["updateClosedDeals",...]) before receiving binary data. However, PocketOption sometimes sends raw JSON binary messages WITHOUT the Socket.IO header when delivering deal results. When this "headerless" binary data arrives, the code at line 326-333 simply logged a warning and discarded the data. I modified crates/binary_options_tools/src/pocketoption/modules/deals.rs to attempt parsing binary data even when there's no Socket.IO header. In my opinion this is just a temporary fix because actually getting the headers back would probably be best.
Yeah, i checked, you are right , there was an error, i fixed it using an older version of the deals.rs file, it seems that in one of the latest updates someone modified it incorrectly causing the bug. In a few hours i will push the fix to github and in a cupple of days i shoud push a new release on pypi that fixes that issue. I will close this thread in a few hours when i push the fix. Please tell us if there is any more issues to work on!
Pushed the fix, closing issue.