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

API Token not allowing issue update #202

Open
IEvangelist opened this issue Aug 30, 2019 · 7 comments
Open

API Token not allowing issue update #202

IEvangelist opened this issue Aug 30, 2019 · 7 comments
Labels
Type: Bug Something isn't working as documented

Comments

@IEvangelist
Copy link

I have an Azure function that handles a GitHub webhook invocation for issues and pull requests. When it fires, I add a label and a reaction -- those both work perfectly. I then try to update either the title or body text of the issue or pull request and it fails.

Here is the StackTrace:

Error while attempting to filter issue: Object reference not set to an instance of an object.
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.DeserializeException(JToken error)
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.DeserializeExceptions(JArray errors)
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.Deserialize[TResult](Func`2 deserialize, JObject data)
   at Octokit.GraphQL.Core.Deserializers.ResponseDeserializer.Deserialize[TResult](Func`2 deserialize, String data)
   at Octokit.GraphQL.Core.SimpleQuery`1.Runner.RunPage(CancellationToken cancellationToken)
   at Octokit.GraphQL.ConnectionExtensions.Run[T](IConnection connection, ICompiledQuery`1 query, Dictionary`2 variables, CancellationToken cancellationToken)
   at IEvangelist.GitHub.Services.GraphQL.GitHubGraphQLClient.UpdateIssueAsync(UpdateIssueInput input) in C:\Users\dapine\source\repos\IEvangelist.GitHub.ProfanityFilter\IEvangelist.GitHub.Services\GraphQL\GitHubGraphQLClient.cs:line 116
   at IEvangelist.GitHub.Services.Handlers.IssueHandler.HandleIssueAsync(IssueEventPayload payload) in C:\Users\dapine\source\repos\IEvangelist.GitHub.ProfanityFilter\IEvangelist.GitHub.Services\Handlers\IssueHandler.cs:line 89

Here is the source code:

https://github.com/IEvangelist/GitHub.ProfanityFilter

Issue handler, invocation to client
Client, invocation to connection with mutation

I'm using an API Token that was just newly created, why would this not work?

@IEvangelist
Copy link
Author

I discovered that this must be a bug with the GraphQL implementation, as I converted over to using the REST based API and it worked. Here is the change

@shiftkey
Copy link
Member

Error while attempting to filter issue: Object reference not set to an instance of an object.

@IEvangelist my psychic debugger thinks there's something weird with how it's deserializing the response. Are you able to extract the query and create a failing test so the maintainers can see the same problem themselves more easily?

@brianaj
Copy link

brianaj commented Sep 17, 2019

Running into same stack trace of this issue and the capability is not available through v3 api. It states during the deserialization "message": "Something went wrong while executing your query. Please include C8E9:02B3:296A2D:314CBC:5D816400 when reporting this issue."

@IEvangelist
Copy link
Author

Hi @brianaj, thanks for sharing! I'm happy that someone else is seeing this too.

I have literally been buried, and it's been extremely difficult to find time to look into this. My workaround was to simply use the Octokit.Net SDK to update the issue since the GraphQL implementation for mutating an issue is clearly broken. It worked and I moved on, I would like to come back to this though. It should be very easy for someone to recreate. Simply try to update an issue using the GraphQL mutation.

For my project, this is the change that I included to get this working... again, simply using both SDKs side-by-side... which doesn't feel good but it works for now.

IEvangelist/GitHub.ProfanityFilter@50dae78#diff-bfef6a25cdd5583e892f47c982da2959

@IEvangelist
Copy link
Author

Error while attempting to filter issue: Object reference not set to an instance of an object.

@IEvangelist my psychic debugger thinks there's something weird with how it's deserializing the response. Are you able to extract the query and create a failing test so the maintainers can see the same problem themselves more easily?

That isn't a terrible idea, however; I'm not sure how I'd be able to extract the response as it is buried in the internals of the ConnectionExtensions. In other words, when my function fires - it correctly deserializes the issue event payload and then uses that to create an issue update mutation. This mutation is then executed against the internals of the connection, and the response occurs within there. I'm not able to capture that...

@brianaj
Copy link

brianaj commented Sep 19, 2019

Hi @brianaj, thanks for sharing! I'm happy that someone else is seeing this too.

I have literally been buried, and it's been extremely difficult to find time to look into this. My workaround was to simply use the Octokit.Net SDK to update the issue since the GraphQL implementation for mutating an issue is clearly broken. It worked and I moved on, I would like to come back to this though. It should be very easy for someone to recreate. Simply try to update an issue using the GraphQL mutation.

For my project, this is the change that I included to get this working... again, simply using both SDKs side-by-side... which doesn't feel good but it works for now.

IEvangelist/GitHub.ProfanityFilter@50dae78#diff-bfef6a25cdd5583e892f47c982da2959

Thanks for the response @IEvangelist. Yes, unfortunately, we are using beta functionality that is not available in the rest client. We are just using graphql client directly for now.

@github-actions
Copy link

github-actions bot commented Dec 3, 2022

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

@github-actions github-actions bot added the Status: Stale Used by stalebot to clean house label Dec 3, 2022
@kfcampbell kfcampbell added Priority: Normal Type: Bug Something isn't working as documented labels Dec 5, 2022
@github-actions github-actions bot removed the Status: Stale Used by stalebot to clean house label Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

5 participants