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

bugfix #2870 #2871

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

bugfix #2870 #2871

wants to merge 4 commits into from

Conversation

b3b00
Copy link

@b3b00 b3b00 commented Jan 30, 2024

Resolves #2870


Before the change?

When trying to delete a file an exception is raised stating System.ArgumentException: The value cannot be null or empty. (Parameter 'mediaType'). And the file is not deleted

After the change?

No exception is raised and the file is deleted.

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?


@kfcampbell
Copy link
Member

Hmm...I'm uncomfortable making this change with such a broad impact. Can it be scoped down to the one request necessary?

@b3b00
Copy link
Author

b3b00 commented Feb 3, 2024

@kfcampbell , I agree that this can be dangerous. I will look at a way to narrow this fix to the delete request and make it available to other kind of request if the issue appears on other. Thanks for your comment

@nickfloyd
Copy link
Contributor

@b3b00 if you get the chance post what your use (code) of the SDK here looks like - specifically I am trying to find out which resource client you're using so that we can help you craft a solution. We have some mechanisms in place to support adding headers to the request - adding where you have will definitely have some side effects for all of the other implementations that use SendData.

@b3b00
Copy link
Author

b3b00 commented Feb 22, 2024

Hello @nickfloyd, my code :

     public override async Task DeleteNote(string noteName)
        {
            if (gitHubClient != null)
            {
                var content = await NoteExists(noteName);
                if (content.exists)
                {
                    // this is were the exception happens
                    var deleteRequest =
                        new DeleteFileRequest($"DendrOnline : delete note {noteName}", content.content.Sha);
                    await gitHubClient.Repository.Content.DeleteFile(RepositoryId,$"notes/{noteName}.md" , deleteRequest);
                }
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🛑 Blocked/Awaiting Response
Development

Successfully merging this pull request may close these issues.

[BUG]: exception "mediatype is null or empty" when trying to delete file
3 participants