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

Planner Plan can't be deleted #2097

Closed
ghost opened this issue Aug 24, 2023 · 4 comments
Closed

Planner Plan can't be deleted #2097

ghost opened this issue Aug 24, 2023 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 24, 2023

Describe the bug
I have a Microsoft 365 E5 Sandbox Tenant where I am developing an app that uses the MsGraph C# SDK. When I use the SDK to delete a PlannerPlan, the SDK does not throw any Exception, but the Plans still apear in the UI of https://tasks.office.com/. I can't click them and when I try to issue another DELETE request with that ID, then I get a 404 back, so Graph seems to think the Plans are deleted. Is the Problem with my Code? Do I need to use an older version of the SDK or write a service that calls the REST Api myself? Am I going to flood my customer's Planner with undeletable plans if I continue with this approach?

To Reproduce
I thought it was my code that produced the error, so I reduced it as much as I could. If I run this sample, then the bug happens.

My Sample App is based on this Microsoft Sample: https://github.com/Azure-Samples/active-directory-dotnetcore-daemon-v2/tree/master/1-Call-MSGraph

It uses Microsoft.Identity.Web.GraphServiceClient in version 2.13.1, which uses Microsoft.Graph in version 5.12.0.

The GroupId is from a Microsoft 365 Group with just mysself as member in that E5 Sandbox Tenant:
image

        public async static Task RecreateBug()
        {
            TokenAcquirerFactory tokenAcquirerFactory = TokenAcquirerFactory.GetDefaultInstance();
            IServiceCollection services = tokenAcquirerFactory.Services;
            services.AddMicrosoftGraph();
            var serviceProvider = tokenAcquirerFactory.Build();

            var graphServiceClient = serviceProvider.GetRequiredService<GraphServiceClient>();
            var AdGroupId = "your-ad-group-id-here";

            // Create the minimum required object to create a PlannerPlan
            var plan = new PlannerPlan
            {
                Container = new PlannerPlanContainer
                {
                    ContainerId = AdGroupId,
                    Type = PlannerContainerType.Group
                },
                Title = "Try and delete me!",
            };

            // Use POST to create the PlannerPlan
            var createdPlan = await graphServiceClient
                .Planner
                .Plans
                .PostAsync(plan, r => r.Options.WithAppOnly());

            // Use GET to get the PlannerPlan, so we can supply the latest "Etag" value to delete
            var retrievedPlan = await graphServiceClient
                .Planner
                .Plans[createdPlan.Id]
                .GetAsync(r => r.Options.WithAppOnly());

            // Use DELETE to delete the PlannerPlan
            await graphServiceClient
                .Planner
                .Plans[retrievedPlan.Id]
                .DeleteAsync(r => {
                    r.Options.WithAppOnly();
                    r.Headers.Add("If-Match", retrievedPlan.AdditionalData["@odata.etag"].ToString());
                });
        }

Expected behavior
The Plans should disappear from the UI at https://tasks.office.com/. In fact, this was still working fine 2 days ago. The problem started yesterday.

Screenshots
When I try to click one of the supposedly deleted plans in the UI, it opens a spinner popup which cant be closed. only page reload helps.

image

When I try to click one of the supposedly deleted plans and check the network tab in the dev tools I get a 404.

image

When I reload the page and check the network tab in the dev tools, I get a lot of 404's.

image

Desktop (please complete the following information):

  • Windows 10
  • Edge
  • Version 116.0.1938.54 (Official build) (64-bit)

Additional context
As you can see, I'm using the Client Credentials Flow for Daemon Apps.

@andrueastman
Copy link
Member

Thanks for raising this @RobertAdesso,

Just to confirm, do the deleted plans eventually stop showing on https://tasks.office.com/ or do they still show up despite getting 404 error when trying to query them on the API?

@ghost
Copy link
Author

ghost commented Aug 25, 2023

The plans are still showing despite getting 404s. They can't be opened either to delete them in the UI. It just opens a spinner popup that stays open forever when I try to click a plan in the list to open it. I found the only way to delete the plans is to use the "Pin" icon in the list on the left. Then I get a popup that the plan doesnt exist anymore and it offers me to delete it. But that's obviously nothing I can tell to the customer :)

@andrueastman
Copy link
Member

@ghost Any chance if you can confirm if the api behaviour is still occurring?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

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

No branches or pull requests

1 participant