fix(sdk): reach the head of account history and keep the savings fill on its own asset - #1404
Conversation
… on its own asset Two follow-ups to #1396. condenser_api.get_account_history asserts start >= limit - 1. The cursor is derived from num alone, so the last window before the start of history is shorter than limit and the request failed the assert instead of returning the rows that were left. The web wallet pages use limit 1000, so a small account hit it a couple of "load more" clicks in. Narrow the requested limit to pageParam + 1 for that window; the -1 sentinel is not an index and passes through untouched. fill_transfer_from_savings had no case in the per-asset select switches, so it fell to the default, which keeps anything the caller named and never checks the symbol. Filtering for it on the HIVE wallet also listed completed HBD withdrawals, and the reverse on HBD. Give it the same guard transfer_from_savings already has in both files. Also corrects the collectRequestedOperations doc comment, which said it ignores group aliases while it keeps them (harmless, they never match an operation name). Fixes #1401 Fixes #1402
|
Warning Review limit reached
Next review available in: 46 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Picks up the account-history follow-ups from ecency/vision-web#1404, on top of the pagination fix #3480 already relies on. - the history walk can reach the head of an account's history instead of failing the node's `start >= limit - 1` assert on the last page - `fill_transfer_from_savings` is filtered by asset, so the HIVE list no longer shows completed HBD savings withdrawals and the reverse
Two follow-ups to #1396. Both are in the SDK wallet queries, both are covered by tests that fail without the source change.
Fixes #1401
Fixes #1402
1. The walk could not reach the head of history
condenser_api.get_account_historyassertsstart >= limit - 1, sincestartis a 0-based index and the node walkslimitentries back from it. The cursor added in #1396 is derived fromnumalone, so the last window before the start of history is necessarily shorter thanlimitand the request failed the assert instead of returning what was left.The web wallet pages use
limit: 1000, so this is two or three "load more" clicks away on a small account. Walking the merged cursor against a node:Now the requested
limitis narrowed topageParam + 1for that window, which asks for exactly the remaining rows:initialPageParamis-1, which is a sentinel rather than an index, so it passes through untouched and the first page still asks for the fulllimit. The cursor itself is unchanged. HBD and HP spread the HIVE options, so all three inherit this.2.
fill_transfer_from_savingsignored the per-asset filterThe operation was added to the fetch layer in #1396 but had no
casein the per-assetselectswitches, so it reached the widened default:which keeps anything the caller named and never looks at the symbol. Picking
Fill transfer from savingson the HIVE wallet also listed completed HBD withdrawals, rendered with their HBD amount, and the reverse on the HBD wallet. It now carries the same guardtransfer_from_savingsalready had in both files.Only reachable through an explicit filter pick, since an unfiltered request still falls through to
false.Also
collectRequestedOperationswas documented as ignoring group aliases while it actually keeps them. Harmless, because a group name never equals an operation name, so the comment is what changed.Verification
pnpm --filter @ecency/sdk test— 712 passed (50 files). Six new cases inaccount-history-pagination.spec.tscover the sentinel passing through, a full window being left alone, the narrowed final window, thestart >= limit - 1invariant across the cursor values the walk can emit, and the HIVE/HBD symbol split forfill_transfer_from_savings. Reverting the two source files leaves exactly those six red.pnpm typecheck— clean across packages andapps/web.pnpm lint— clean, only the pre-existing a11y warnings inapps/web.dist/is not rebuilt here, that stays label-gated. Mobile is on@ecency/sdk@2.3.80, so this needs a release before ecency/vision-mobile#3480 picks it up.