Skip to content

fix(streams): recover cross-venue WebSocket feeds - #423

Merged
brokermr810 merged 130 commits into
mainfrom
test
Nov 28, 2026
Merged

brokermr810 merged 130 commits into
mainfrom
test

Conversation

@brokermr810

Copy link
Copy Markdown
Collaborator

Root cause

WebSocket transport/authentication success did not always prove that the requested stream was subscribed or delivering usable data. Missing application-heartbeat handling and stale reconnect state could leave price or execution streams unavailable while recovery remained incomplete. Bitget Classic order size could also be mistaken for executed quantity.

Changes

  • Require expected private subscription acknowledgements for OKX, Bybit, Bitget and HTX; report subscription rejection or startup timeout without stopping the strategy's REST reconciliation.
  • Detect missing application pongs and recover connections using bounded backoff. Public feed readiness requires valid finite, positive prices.
  • Use HTX linear USDT contract topics and route Bitget private streams through the existing Classic/UTA account-mode resolver.
  • Preserve Bitget Classic instrument/order identifiers and cumulative fills; do not treat unfilled requested size as a fill.
  • Document cross-venue recovery, same-venue REST fallback, and deployment boundaries.

Companion repositories

Published directly to their normal branches:

  • Desktop main: 98ed0a4 — recover candle/order-book streams, discard stale snapshots, and preserve candle boundaries while reducing repeated position-overlay work.
  • Mobile master: 4d64dc9 — matching recovery semantics and candle-boundary updates.

Validation

  • 120 backend regression tests passed in a Linux Docker container with networking disabled: public-price feeds, private adapters/normalizers/supervisor, late-fill recovery, Bitget account routing, and runtime fee synchronization.
  • Desktop: 890 unit tests passed; production build passed; full ESLint check completed with 0 errors (existing warnings remain).
  • Mobile: 270 unit tests passed; production build passed.
  • Backend Ruff, structure, documentation, encoding and version checks passed.
  • Build output remained in system temporary directories; no generated bundles or credentials were committed.

Deployment and risk

  • No database migration or production data rewrite.
  • Deploy backend/trading workers and the corresponding desktop/mobile revisions.
  • REST reconciliation, request guards, stale-price safeguards and account ownership remain in place. These changes do not submit trades or clear exchange bans.
  • Automated protocol/recovery tests are not live-account certification; verify private subscription readiness and fallback behavior in the deployed environment.
  • Cloud CI/security checks and human review are still required before merging.

tianhe added 30 commits November 1, 2026 17:17
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/app/routes/community.py
tianhe and others added 18 commits November 27, 2026 15:35
The main tree exactly matches the pre-fix test tree. Record the merged ancestry while preserving the verified fee fixes.

Signed-off-by: TIANHE <[email protected]>
The merged main tree exactly matches the pre-change test tree; preserve the verified HK identity fixes while recording merge ancestry.

Signed-off-by: TIANHE <[email protected]>
Keep completed-session and execution-price freshness checks intact, allow eligible newly listed equities to satisfy declared warmup, and fail over HK candle providers with bounded Tencent cooldown.

Validation: 382 focused Linux regression tests passed; Ruff, backend quality, encoding and version checks passed.
Signed-off-by: TIANHE <[email protected]>
Expose a restart-scoped 1-60 minute quote-age setting with a 16-minute default, align equity receipt expiry, retain provider timestamp and session checks, and document delayed-feed risks.

Validation: 215 focused backend tests passed; Ruff, backend quality, encoding and version checks passed.
Signed-off-by: TIANHE <[email protected]>
The merged main tree exactly matches the pre-change test tree; preserve the verified quote-policy changes while recording merge ancestry.

Signed-off-by: TIANHE <[email protected]>
Signed-off-by: Prakash Jha <[email protected]>
(cherry picked from commit a5c7b82)
Signed-off-by: TIANHE <[email protected]>
@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@brokermr810
brokermr810 merged commit f859fcc into main Nov 28, 2026
15 checks passed
MrRakun35 pushed a commit to MrRakun35/NovaTrade that referenced this pull request Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants