microsoftgraph / microsoftgraph/msgraph-sdk-dotnet

Draft email inline images duplicated exponentially when adding PDF attachments via Graph API

Open
#2,937 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

When creating a draft email with a signature containing inline images (e.g., 6 images), the Graph API initially returns the correct number of attachments (6). However, after adding a PDF attachment to the same draft, the API returns duplicated inline image attachments (13 total - 6 original + 6 duplicates + 1 PDF). On subsequent API calls, the inline images continue to multiply exponentially (e.g., each inline image appears 4 times on the next call).

Expected behavior

Initial draft creation: 6 inline image attachments
After adding PDF: 7 total attachments (6 inline images + 1 PDF)
Subsequent API calls should maintain the same 7 attachments without duplication
Inline images should appear only once regardless of how many times attachments are added or the draft is accessed

How to reproduce

Create a draft email with a signature containing 6 inline images
Call Graph API to retrieve attachments - confirm 6 attachments returned
Add a PDF attachment to the same draft via Graph API
Call Graph API to retrieve attachments - observe 13 attachments (inline images duplicated)
Make another API call to retrieve attachments - observe inline images now duplicated more times each
Each subsequent call continues to duplicate the inline image attachments

SDK Version

Latest

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 draft-email sequence described in the issue: create a signature with six inline images, add a PDF through the Graph API, and retrieve attachments after each call. Investigate the SDK behavior around attachment handling; done means the six inline images remain single instances and the PDF is the only additional attachment across subsequent calls.

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.