Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

buildIndexedQuery ignores sort for CustomerUsers #39

@victor-ochoa-td

Description

@victor-ochoa-td

Steps to reproduce

Create and execute a build indexed query for Cusomer Users specifying pageSize and index:

IQuery query = QueryFactory.getInstance().buildIndexedQuery(pageSize, pageIndex, null, new Sort("userPrincipalName",SortDirection.DESCENDING)));
return customer.getUsers().query(query);

Expected behavior

Get a SeekBasedResourceCollection with a subset of users for customer sorted by
userPrincipalName
Example. This is the complete list of users for our test customer (I am just showing the user names to make it more legible):

[
  "Admin",
  "User 1",
  "User 2",
  "User 3",
  "User 4",
  "User 5"
]

For the following buildIndexedQuery (pageSize = 2, index = 0, sortField = userPrincipalName , sortDirection = descending):

IQuery query = QueryFactory.getInstance().buildIndexedQuery(2,0,null,new Sort("userPrincipalName",SortDirection.DESCENDING)) );

The result should be:

[
  "User 5",
  "User 4",
]

Actual behavior

[
  "Admin",
  "User 1"
]

No matter which value we specify for sort or sortDirection, the results always are sorted by the default sorting field (userPrincipalName if I am not wrong) and direction ascending..

Diagnostic logs

I've been able to debug the whole process and the request generated for CustomerUsersCollectionOperations is the following:

https://api.partnercenter.microsoft.com/v1/customers/[CUSTOMER_ID]/users?&size=2&null=%userPrincipalName%22&null=%22descending%22

Environment

I've tested from Linux Mint with Eclipse Oxygen.
Partner center SDK:
I've tested 1.12.0 and 1.8.0. Same result for both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions