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

Updating a recurring event instance operation never completes #2170

Closed
arseni-radziuk opened this issue Sep 27, 2024 · 4 comments
Closed

Updating a recurring event instance operation never completes #2170

arseni-radziuk opened this issue Sep 27, 2024 · 4 comments
Assignees
Labels

Comments

@arseni-radziuk
Copy link

Describe the bug

I am trying to modify an instance or a recurring event but this operation fails.

Expected behavior

I should be able to modify a recurring event instance as this operation worked successfully in the previous versions of the library.

How to reproduce

  1. Create a recurring events with any pattern (e.g., weekly event occurring on Thursday and Friday starting today and with end date in 2 months).
  2. Query occurring event and then query a list of its instances.
  3. Take any of the queried instances and try to modify it (e.g., by setting a new subject). The operation is never completed. It looks like this operation causes an infinite loop in the library.

SDK Version

6.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

As I workaround I am able to delete the occurrence instance and then create another event.

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@arseni-radziuk arseni-radziuk added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Sep 27, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Sep 30, 2024

Hi @arseni-radziuk, thank you for reporting this issue.
Could you please share the failing code sample?

@Ndiritu Ndiritu added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Oct 1, 2024
@arseni-radziuk
Copy link
Author

Hi @Ndiritu, please see the code sample below.

       public List<Event> getInstanceEvents(String resourceId, Event masterEvent) {
        List<Event> instanceEvents = new ArrayList<>();
        LocalDateTime startDateParam = LocalDateTime.now();
        LocalDateTime endDateParam = LocalDateTime.now().plusMonths(2);
        EventCollectionResponse eventCollectionPage;
        do {
            eventCollectionPage = calendarClient.getGraphClient().users().byUserId(resourceId)
                    .events().byEventId(masterEvent.getId()).instances().get(getRequestConfiguration -> {
                        getRequestConfiguration.queryParameters.startDateTime = startDateParam.toString();
                        getRequestConfiguration.queryParameters.endDateTime = endDateParam.toString();
                        getRequestConfiguration.queryParameters.top = 100;
                        getRequestConfiguration.queryParameters.skip = instanceEvents.size();
                    });
            instanceEvents.addAll(eventCollectionPage.getValue());
        } while (CollectionUtils.isNotEmpty(eventCollectionPage.getValue()));
        instanceEvents.sort(Comparator.comparing(GraphApiUtils::getStartDate));
        return instanceEvents;
    }    

Then on the retrieved instances the following call is made:
instances.get(3).setSubject("test");

I was only able to reproduce the issue with weekly pattern occurring on Thursday and Friday starting today and with end date in 2 months (as e.g. with daily pattern it worked fine for me).

Also, I can see the following stack trace caused by subject update operation:
image

@Ndiritu
Copy link
Contributor

Ndiritu commented Oct 2, 2024

Thank you for sharing this @arseni-radziuk.
This should be resolved in the latest version of this SDK 6.17.0 (release in progress). Kindly upgrade and let me know if the bug is resolved.

@Ndiritu Ndiritu self-assigned this Oct 2, 2024
@Ndiritu Ndiritu added the status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close label Oct 7, 2024
@arseni-radziuk
Copy link
Author

@Ndiritu The bug is resolved for my case, thank you.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Oct 8, 2024
@Ndiritu Ndiritu closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants