Commit e0cf83d
committed
fix: resolve all remaining type issues in OrderManager
- Remove duplicate protective_side declarations in bracket_orders.py
- Add _unlink_oco_orders to OrderManagerProtocol for proper type checking
- Fix union type handling in position_orders.py with proper type narrowing
- Clean up unused parameters and improve type annotations in tracking.py
- Fix orderbook test to use synchronous get_memory_stats() (v3.3.0 compat)
All 8 critical issues from PR #51 are now resolved:
✅ Race condition in bracket orders - Fixed with proper async synchronization
✅ Memory leaks in tracking - Fixed with TTL caches and cleanup tasks
✅ Deadlock potential - Fixed with single lock ordering
✅ Price precision - Fixed with Decimal arithmetic
✅ Order state validation - Fixed with comprehensive validation
✅ Tick size validation - Fixed with proper price alignment
✅ Error recovery - Fixed with complete recovery system
✅ Event handler robustness - Fixed with proper data validation
Tests: All 33 OrderManager tests passing
Type checking: Zero mypy errors
Linting: All ruff checks pass
IDE diagnostics: Zero issues1 parent 20ccb80 commit e0cf83d
File tree
5 files changed
+30
-26
lines changed- src/project_x_py
- order_manager
- types
- tests/orderbook
5 files changed
+30
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
| |||
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| |||
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | 333 | | |
336 | 334 | | |
| 335 | + | |
337 | 336 | | |
338 | 337 | | |
339 | 338 | | |
| |||
460 | 459 | | |
461 | 460 | | |
462 | 461 | | |
463 | | - | |
| 462 | + | |
464 | 463 | | |
465 | 464 | | |
466 | 465 | | |
| |||
486 | 485 | | |
487 | 486 | | |
488 | 487 | | |
489 | | - | |
| 488 | + | |
490 | 489 | | |
491 | 490 | | |
492 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
| |||
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
424 | | - | |
| 426 | + | |
425 | 427 | | |
426 | 428 | | |
427 | 429 | | |
| |||
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
435 | | - | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
446 | 448 | | |
447 | 449 | | |
448 | 450 | | |
449 | | - | |
450 | | - | |
| 451 | + | |
| 452 | + | |
451 | 453 | | |
452 | 454 | | |
453 | 455 | | |
| |||
460 | 462 | | |
461 | 463 | | |
462 | 464 | | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
| 465 | + | |
468 | 466 | | |
469 | 467 | | |
470 | 468 | | |
471 | 469 | | |
472 | | - | |
| 470 | + | |
473 | 471 | | |
474 | 472 | | |
475 | 473 | | |
| |||
478 | 476 | | |
479 | 477 | | |
480 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
481 | 484 | | |
482 | 485 | | |
483 | 486 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
509 | 509 | | |
510 | | - | |
| 510 | + | |
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| |||
754 | 754 | | |
755 | 755 | | |
756 | 756 | | |
757 | | - | |
| 757 | + | |
| 758 | + | |
758 | 759 | | |
759 | 760 | | |
760 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
0 commit comments