Code Monkey home page Code Monkey logo

Comments (5)

gyandeeps avatar gyandeeps commented on August 17, 2024

@bkeepers and @hiimbex would really appreciate your insight into this. Thanks a lot.

from eslint-github-bot.

not-an-aardvark avatar not-an-aardvark commented on August 17, 2024

(Note: This issue wasn't originally intended to be a bug report to GitHub, but I'll add some more info since a few people have been pinged already. Let me know if I should report this somewhere else.)

Here's some more information about the particular events:

  • X-GitHub-Delivery: fafe2c30-bdf8-11e7-922b-a3c8d44a5819 is an example of a case where an issue-opened payload already contained the initial label on the issue. (This was followed by the fb061b70-bdf8-11e7-9188-71dde51a7192 delivery for adding the label.)
  • X-GitHub-Delivery: 041a7a80-bdf9-11e7-8c3c-936b8cd0b1a1 is an example of a case where an issue-opened payload did not contain the initial label on the issue. (This was followed by the 0422def0-bdf9-11e7-91ff-209baad94d9a delivery for adding the label.)

In both cases, the issue was created with labels using the labels option on node-github, which I think maps directly to the labels GitHub API option when creating the issue. Since the label is added at the same time as the issue is created, I would expect the initial issue-opened payload to always contain the label (or, at least, I would expect the behavior to be consistent).

from eslint-github-bot.

hiimbex avatar hiimbex commented on August 17, 2024

I have not had a chance to look into this issue in depth (I will try shortly); however, I am aware of several similar race conditions that occur within the GitHub API. So the solution may be just waiting until after the payload had been received and making a follow up API call to get the correct label data.

from eslint-github-bot.

not-an-aardvark avatar not-an-aardvark commented on August 17, 2024

Thanks for the response, that seems reasonable to me. Do you think making a separate API request would always avoid the issue? (My thinking is that if the issue is in an intermediate state without labels at the time that the webhook gets sent, it seems plausible that it would still be in the intermediate state when the next API call arrives. But I'm not sure whether that is actually a possibility.)

from eslint-github-bot.

hiimbex avatar hiimbex commented on August 17, 2024

I would imagine the additional API call would solve the problem, but not sure. Also the context.isBot method might also be useful to ignore issues created by the bot itself.

from eslint-github-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.