Skip to content
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

[Bug] getVaultAccountsWithPageInfo not working when namePrefix contains a pound symbol #98

Open
onejmi opened this issue Jun 23, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@onejmi
Copy link

onejmi commented Jun 23, 2022

Describe the bug
When calling getVaultAccountsWithPageInfo with a namePrefix that contains a pound symbol (ex. 'Account#'), I am unable to query past the first page of results (i.e the function always returns the same accounts).

   const requestFilters: PagedVaultAccountsRequestFilters = {
         namePrefix: 'Account#',
         orderBy: 'ASC',
         limit: 2 
    };

    let vaultAccounts = await this.fireblocks.getVaultAccountsWithPageInfo(requestFilters);
    
    while (vaultAccounts.paging.after) {
          console.log(vaultAccounts.accounts); //ALWAYS PRINTS THE SAME 2 ACCOUNTS
          requestFilters.after = vaultAccounts.paging.after; 
          vaultAccounts = await this.fireblocks.getVaultAccountsWithPageInfo(requestFilters);
    }

To Reproduce

  1. Create more than 2 vault accounts that have names that start with 'Account#'
  2. Run the code above
  3. Same accounts are printed repeatedly and loop does not exit

Expected behavior
After updating the after cursor in the requestFilters object, getVaultAccountsWithPageInfo should return the next 2 accounts and not the initially queried accounts when called. The loop in the code above should exit after moving through the full list of vaults.

Version:

  • fireblocks-sdk version: 2.1.0
  • npm version: 8.11.0
  • node version: v16.15.1

Additional context
When I remove the pound symbol from namePrefix, the paging seems to work fine.

@onejmi onejmi added the bug Something isn't working label Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants