-
Notifications
You must be signed in to change notification settings - Fork 13
Update remove order polling after removing order #2349
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
base: 2025-12-04-order-polling
Are you sure you want to change the base?
Update remove order polling after removing order #2349
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes introduce a two-phase polling mechanism for fetching remove orders (querying local database first, then subgraph with retry logic), expose a WASM binding with configurable polling parameters, update error messaging, and integrate the new SDK-based indexing approach in the UI transaction manager with corresponding test coverage. Changes
Sequence DiagramsequenceDiagram
participant UI as UI Layer
participant TM as TransactionManager
participant RC as RaindexClient
participant LDB as Local DB
participant SG as Subgraph
UI->>TM: createRemoveOrderTransaction()
TM->>RC: get_remove_orders_for_transaction_wasm_binding()
RC->>LDB: Query local database
alt Local DB Available & Supported
LDB-->>RC: Return orders (if found)
alt Orders Found
RC-->>TM: Return orders
else Orders Empty
Note over RC: Proceed to subgraph polling
RC->>SG: Poll for orders (attempt 1)
loop Retry with interval
alt Orders Found
SG-->>RC: Return orders
RC-->>TM: Return orders
else Empty/Error
RC->>RC: Sleep interval_ms
RC->>SG: Poll for orders (attempt N)
end
end
alt Max Attempts Exceeded
RC-->>TM: SubgraphIndexingTimeout error
end
end
else Local DB Unavailable
Note over RC: Skip to subgraph polling
RC->>SG: Poll for orders (attempt 1)
loop Retry with interval
alt Orders Found
SG-->>RC: Return orders
RC-->>TM: Return orders
else Empty/Error
RC->>RC: Sleep interval_ms
RC->>SG: Poll for orders (attempt N)
end
end
alt Max Attempts Exceeded
RC-->>TM: SubgraphIndexingTimeout error
end
end
TM-->>UI: Invoke onSuccess/onError callback
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
cb71258 to
16b357c
Compare
Chained PR
Motivation
Just like the add order functionality, we are now implementing the polling mechanism to remove order path.
Solution
getRemoveOrdersForTransactionwasm binding to poll from local db and subgraphChecks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
Bug Fixes
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.