Skip to content

Fix account picker infinite loading during Ledger import - #2496

Open
Maskln wants to merge 1 commit into
v2from
fix-bug-infinite-loading-import-account-page
Open

Fix account picker infinite loading during Ledger import#2496
Maskln wants to merge 1 commit into
v2from
fix-bug-infinite-loading-import-account-page

Conversation

@Maskln

@Maskln Maskln commented Jun 19, 2026

Copy link
Copy Markdown
Member

paired with: https://github.com/AmbireTech/ambire-app/pull/7408

Summary

  • Add #setPageGeneration to invalidate in-flight setPage() requests and clear accountsLoading on reset()
  • Fix invalid page (<= 0) leaving the spinner active
  • Apply pageSize from setInitParams earlier so the UI can become ready sooner
  • Improve Ledger error normalization for benign SDK states (none, empty interaction)
  • Add test for invalid page clearing accountsLoading

expect(controller.accountsLoading).toBe(false)
expect(controller.pageError).toBeTruthy()
expect(controller.page).toEqual(DEFAULT_PAGE)
})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the context behind this test. setPage({ page: 0 }) isn't reachable anyways - every caller in the UI already guards it (pagination, navigation, etc).

This either makes no sense, or covers a corner case that's not explained?

Meanwhile the change this PR actually exists for - the #setPageGeneration stale-request guard - has no test coverage.

So either swap this test for one that calls two setPage calls (assert the later page wins), or one where reset() interrupts an in-flight setPage and test if accountsLoading still lands on false.

Those would fail before the fix and actually protect the race, which would ultimately validate that the changes in this PR are actually fixing problem(s).

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.

2 participants