Skip to content

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

@ciborowskik

Description

@ciborowskik

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_

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:waiting-for-triageAn issue that is yet to be reviewed or assignedtype:bugA broken experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions