镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

PageIterator is using getDeclaredMethods instead of getMethods. If inheritance is used wrong way of returning oDataNextLink is used #1452

Closed

Description

@JozefDropco

Expected behavior

List of all groups belonging to a user

Actual behavior

First page of 100 groups returned

Steps to reproduce the behavior

        List<String> lst = new ArrayList<>();
        GroupCollectionResponse user = graphServiceClient.users().byUserId("xxxx_xxxxx@xxxx.com").memberOf().graphGroup().get();
        PageIterator iterator = new PageIterator.Builder<Group, GroupCollectionResponse>()
                .client(graphServiceClient)
                .collectionPage(user)
                .collectionPageFactory(GroupCollectionResponse::createFromDiscriminatorValue)
                .processPageItemCallback(group -> {
                    System.out.println(group.getDisplayName());
                    lst.add(group.getDisplayName());
                    return true;
                })
                .build();
        iterator.iterate();
        System.out.println(lst.size());

Activity

  1. baywet commented on Feb 8, 2024

    @baywet
    Member

    Hi JozefDropco
    Can you confirm which version of the SDK you are using?

  2. JozefDropco commented on Feb 8, 2024

    @JozefDropco
    Author

    Hi Vincent Biret (@baywet) my mother-in-law died, I will ask my collegue to find this information or I will update you once I am again working.

  3. baywet commented on Feb 8, 2024

    @baywet
    Member

    I'm sorry for your loss. Please take the time you need

  4. baywet commented on Feb 8, 2024

    @baywet
    Member

    michalchotvac (@MichalChotvac) following up from my comment here microsoftgraph/msgraph-sdk-java#1784

    The faulty code that this issue author's was mentioning is located here

    Method[] methods = parsableCollection.getClass().getDeclaredMethods();

    Would you be willing/able to submit a pull request to address the issue?

  5. MichalChotvac commented on Feb 8, 2024

    @MichalChotvac

    Hello Vincent Biret (@baywet) , Ramses Sanchez-Hernandez (@ramsessanchez) can you please submit a pull request to address the issue as I can see the issue is assigned to you, it will be much faster :)

  6. MichalChotvac commented on Feb 9, 2024

    @MichalChotvac

    Hello Vincent Biret (@baywet) , after replacing the

    .getDeclaredMethods() 

    with

    .getMethods() 

    and publishing it locally, I got following error:

    java.lang.ReflectiveOperationException: Could not extract nextLink from parsableCollection.
    	at com.microsoft.graph.core.tasks.PageIterator.extractNextLinkFromParsable(PageIterator.java:314)
    	at com.microsoft.graph.core.tasks.PageIterator.intrapageIterate(PageIterator.java:223)
    	at com.microsoft.graph.core.tasks.PageIterator.iterate(PageIterator.java:270)

    Can you please check?

  7. baywet commented on Feb 9, 2024

    @baywet
    Member

    Hi,
    Unfortunately we're a bit short-handed here.
    But Philip Gichuhi (@Ndiritu) took over this bug and we can expect to have a fix during the next week.
    Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions