fireblocks-sdk-js icon indicating copy to clipboard operation
fireblocks-sdk-js copied to clipboard

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

Open onejmi opened this issue 3 years ago • 0 comments

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 avatar Jun 23 '22 04:06 onejmi