Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

Commit 8f87552

Browse files
authored
Merge pull request #51 from ChipaDevTeam/copilot/fix-order-results-checks
Fix check_order_result to prioritize completed orders over active orders
2 parents 237578a + 7f76426 commit 8f87552

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/get_active_orders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async def main():
99
if orders:
1010
print("Active Orders:")
1111
for order in orders:
12-
print(f"Order ID: {order['id']}, Amount: {order['amount']}, Status: {order['status']}")
12+
print(f"Order ID: {order.order_id}, Amount: {order.amount}, Status: {order.status}")
1313
else:
1414
print("No active orders found.")
1515

pocketoptionapi_async/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,14 +566,14 @@ async def check_order_result(self, order_id: str) -> Optional[OrderResult]:
566566
Returns:
567567
OrderResult: Order result or None if not found
568568
"""
569-
# First check active orders
570-
if order_id in self._active_orders:
571-
return self._active_orders[order_id]
572-
573-
# Then check completed orders
569+
# First check completed orders (prioritize final results over active orders)
574570
if order_id in self._order_results:
575571
return self._order_results[order_id]
576572

573+
# Then check active orders
574+
if order_id in self._active_orders:
575+
return self._active_orders[order_id]
576+
577577
# Not found
578578
return None
579579

0 commit comments

Comments
 (0)