-
Notifications
You must be signed in to change notification settings - Fork 30
pending trades(?) and historical data fetching #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…r PartialEq Add 10s timeout to `get_history` and `open_pending_order` to prevent hanging Implement `Clone` for `HistoricalDataHandle` and `PendingTradesHandle` Update `Validator::PartialEq` to correctly compare `Regex` and `Custom` variants
- Added `explicit_disconnect` flag to `ClientRunner` struct. - Updated `ClientBuilder` to initialize `explicit_disconnect` to `false`. - Modified `ClientRunner::run` to check `explicit_disconnect` flag. - If true, the runner waits for `Connect` or `Reconnect` commands before proceeding. - Handles `Shutdown` command while in disconnected state. - Updated `RunnerCommand::Disconnect` handling to set `explicit_disconnect` to `true`. - Verified with unit test `test_explicit_disconnect` (removed before commit).
- Added `native-tls` dependency to `crates/core`. - Updated `try_connect_single` in `crates/core/data/connection.rs` to correctly configure the `Connector`. - Implemented `TlsConnector` builder logic to support disabling SSL verification when `ssl_verify` is false. - Added error handling for TLS connector creation.
The trades module run loop is already implemented, so the TODO comment asking to implement it is stale and misleading. This commit removes the comment.
Removed a stale TODO block in `crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs` within the `remove_subscription` method, as the subscription removal logic was already implemented.
The TODO block in `Command::Subscribe` handler was describing functionality that is already implemented in the subsequent code. Verified by running `cargo check` and running existing tests (ignoring known failures). Added a temporary test `subscription_tests.rs` to verify the logic, which passed, then removed it.
This commit addresses a FIXME in `SubscriptionCallback` where the reconnection delay was hardcoded to 2 seconds. The `State` struct in `crates/binary_options_tools/src/pocketoption/state.rs` now includes a `reconnection_delay` field, which can be configured via `StateBuilder`. The `SubscriptionCallback` now uses this configured delay instead of the hardcoded value. The default value remains 2 seconds to preserve existing behavior.
The main run loop for the `SubscriptionsApiModule` is already implemented, handling commands and messages as required. The TODO comment was outdated and has been removed.
…207153 Remove stale TODO for subscription removal
…todo-14431598510505383571 Remove stale TODO in subscription module
…39444205817674938 Make reconnection delay configurable in PocketOption State
…tions-3512886914171586518 Remove stale TODO comment for main run loop in subscriptions module
…983687924812454933 Remove stale TODO for trades run loop
…345628546826988765 feat(core): support disabling SSL verification in connection manager
…3924372749280862 Implement persistent disconnect state in ClientRunner
…4543168115797 Refactor RawApiModule to use shared State for sinks and keep_alive messages
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request includes several changes, including downgrading the Rust edition from 2024 to 2021, removing the CI workflow file, adding a get_trade_history function and get_deal_end_time function, adding a HistoricalDataApiModule for handling historical data requests, adding a PendingTradesApiModule for handling pending trade orders, and adding various improvements and fixes. The code review comments highlight the critical issue of removing the CI workflow file, request confirmation on downgrading the Rust edition, suggest including message content in a warning message, and commend the logic for handling duplicate history requests and the robust error handling in get_server_datetime.
I am having trouble creating individual review comments. Click here to see my feedback.
BinaryOptionsToolsV2/.github/workflows/CI.yml (1-169)
The removal of the CI workflow file is a critical issue. Without automated testing and build processes, it becomes significantly harder to maintain code quality, catch regressions, and ensure the reliability of the project. This should be reinstated or replaced with an equivalent automated process.
BinaryOptionsToolsV2/Cargo.toml (4)
The Rust edition has been downgraded from 2024 to 2021. While 2021 is a stable edition, downgrading might indicate compatibility issues with other tools or dependencies that were not explicitly mentioned. Please ensure this change is intentional and doesn't introduce any limitations or prevent future upgrades to newer Rust features.
crates/binary_options_tools/Cargo.toml (4)
The Rust edition has been downgraded from 2024 to 2021. Please confirm this change is intentional and necessary, as it might limit the use of newer Rust language features or indicate compatibility constraints with other parts of the project or toolchain.
crates/binary_options_tools/src/pocketoption/modules/deals.rs (237-239)
The warning message Received unexpected binary message when no header was seen. is good for debugging. However, it might be beneficial to include the actual message content (or a truncated version) in the warning to provide more context when this occurs, helping to identify the source of unexpected messages.
crates/binary_options_tools/src/pocketoption/modules/subscriptions.rs (446-465)
The added logic to handle duplicate history requests and send a HistoryFailed response is a good improvement for robustness. It prevents the system from being overwhelmed by redundant requests and provides clear feedback to the caller.
crates/binary_options_tools/src/pocketoption/state.rs (198-206)
The added match statement for DateTime::from_timestamp in get_server_datetime provides more robust error handling. Instead of unwrap_or_else, it now logs a warning if the timestamp conversion fails and defaults to Utc::now(), which is a safer approach.
crates/binary_options_tools/src/pocketoption/utils.rs (58-66)
Using the IPIFY_URL constant and adding a match statement to handle the json["ip"].as_str() result improves robustness. It prevents an unwrap() call from panicking if the 'ip' field is missing or not a string, providing a more graceful error handling mechanism.
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
…TEDXXXXXXXX","uid":"XXXXXXXX","lang":"en","currentUrl":"cabinet/demo-quick-high-low","isChart":1}]
Updated release step to include wheels
Updated manylinux version and adjusted CI settings.
Updated CI workflow to use fixed Ubuntu version and improved Python setup.
Comment out Emscripten setup steps in CI workflow.
Updated conditions for release and publish steps in CI workflow.
Add MATURIN_PYPI_TOKEN environment variable for PyPI publishing.
Updated installation commands for pip to use local wheel files instead of URLs.
Bumps the cargo group with 1 update in the /BinaryOptionsToolsV2 directory: [ring](https://github.com/briansmith/ring). Bumps the cargo group with 1 update in the /crates/binary_options_tools directory: [ring](https://github.com/briansmith/ring). Bumps the cargo group with 5 updates in the /crates/core directory: | Package | From | To | | --- | --- | --- | | [tokio](https://github.com/tokio-rs/tokio) | `1.43.0` | `1.49.0` | | [tracing-subscriber](https://github.com/tokio-rs/tracing) | `0.3.19` | `0.3.20` | | [ring](https://github.com/briansmith/ring) | `0.17.8` | `0.17.14` | | [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) | `0.5.14` | `0.5.15` | | [openssl](https://github.com/rust-openssl/rust-openssl) | `0.10.70` | `0.10.75` | Updates `ring` from 0.17.8 to 0.17.14 - [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md) - [Commits](https://github.com/briansmith/ring/commits) Updates `ring` from 0.17.11 to 0.17.14 - [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md) - [Commits](https://github.com/briansmith/ring/commits) Updates `tokio` from 1.43.0 to 1.49.0 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](tokio-rs/tokio@tokio-1.43.0...tokio-1.49.0) Updates `tracing-subscriber` from 0.3.19 to 0.3.20 - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](tokio-rs/tracing@tracing-subscriber-0.3.19...tracing-subscriber-0.3.20) Updates `ring` from 0.17.8 to 0.17.14 - [Changelog](https://github.com/briansmith/ring/blob/main/RELEASES.md) - [Commits](https://github.com/briansmith/ring/commits) Updates `crossbeam-channel` from 0.5.14 to 0.5.15 - [Release notes](https://github.com/crossbeam-rs/crossbeam/releases) - [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md) - [Commits](crossbeam-rs/crossbeam@crossbeam-channel-0.5.14...crossbeam-channel-0.5.15) Updates `openssl` from 0.10.70 to 0.10.75 - [Release notes](https://github.com/rust-openssl/rust-openssl/releases) - [Commits](rust-openssl/rust-openssl@openssl-v0.10.70...openssl-v0.10.75) --- updated-dependencies: - dependency-name: ring dependency-version: 0.17.14 dependency-type: indirect dependency-group: cargo - dependency-name: ring dependency-version: 0.17.14 dependency-type: indirect dependency-group: cargo - dependency-name: tokio dependency-version: 1.49.0 dependency-type: indirect dependency-group: cargo - dependency-name: tracing-subscriber dependency-version: 0.3.20 dependency-type: direct:production dependency-group: cargo - dependency-name: ring dependency-version: 0.17.14 dependency-type: indirect dependency-group: cargo - dependency-name: crossbeam-channel dependency-version: 0.5.15 dependency-type: indirect dependency-group: cargo - dependency-name: openssl dependency-version: 0.10.75 dependency-type: indirect dependency-group: cargo ... Signed-off-by: dependabot[bot] <support@github.com>
…oolsV2/cargo-03b80ef897 Bump the cargo group across 3 directories with 5 updates
honestly rust syntax is so confusing to me and half of this is AI lmfao so im not sure what exactly works or not
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.