microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

DELETE message call return HTTP 403 instead of HTTP 404 when using immutable ids

Open
#3,047 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Service issue type:bug
Dominant language
C#
Stars
789
Forks
264
Avg merge
15h 17m
Merged PRs (30d)
3

Description

Describe the bug

Hello,

I'm using Microsoft.Graph C# nuget package version 5.97.0.

I'm getting emails from outlook, process them and delete at the end.

Sometimes during delete attempt, message already doesn't exists in the mailbox. In such a case I get HTTP 404 response. It's normal. But when I use immutable ids - I get HTTP 403 response instead of 404. I think it should be still 404...

Expected behavior

If we want to delete message that doesn't exists we should get HTTP 404 response nevertheless we use immutable ids or not

How to reproduce
  1. Get message using Prefer: "IdType="ImmutableId"" header
  2. Delete message using id retrieved in step 1.
  3. Try to delete the same message again

Expected: second delete call returns 404
Current: second delete call return 403 with content {"error":{"code":"ErrorCannotDeleteObject","message":"Object cannot be deleted."}}

SDK Version

5.97.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the DELETE sequence against Microsoft.Graph C# NuGet package 5.97.0: retrieve a message with Prefer: "IdType="ImmutableId"", delete it, then repeat the delete. Compare the second response with deletion using a regular ID; done means the already-deleted immutable-ID message returns HTTP 404 rather than HTTP 403 ErrorCannotDeleteObject.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.