-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow user to initialize or pass in an ETag value for Events client #1636
Comments
Yeah this would definitely be a cool feature to add! According to the docs "most API functions" will support ETag and/or Last-Modified header... which can be specified in The trick is, how to implement it gracefully! We currently expose the ETag (and can also add the LastModified field) header values via the exiting In terms of specifying the ETag or ModifiedSince values on requests in a broad/elegant way, we could think about adding support for these on our Things to think about
|
Hey folks - I'm working on a GitHub App that receives webhook events and ends up making calls back into GitHub to update checks. Its all going well but occasionally the PR status ends up in an inconsistent state when my code may have set in conflicting check run status/conclusion calls. The problem I'm facing is that the incoming webhook events may come in on any of a host of machines that are processing events and so there is a natural race condition that occurs. Ideally this is where support for ETags would help because my API would be able to query the status of a check (noting the ETag) - evaluate a few conditions and then attempt to update the check providing the ETag. If the ETag had changed then I could get an error. Basically what I'm after is some kind of concurrency, ETag or upset mechanism. It looks like the REST API provides this but it isn't exposed via Octokit. |
@mitchdenny yeah, this is something we've been thinking about for a while but haven't really figured out #352. If there's a specific area of the codebase that you'd like to see this supported I'd be open to experimenting with how this might be supported as a spike. I'd love for this to be more elegant than "just add another parameter, it'll be fiiiine" because between this and pagination and the actual parameters a caller can provide we're definitely hitting a maintenance wall here keeping track of what each endpoint actually supports without overwhelming callers. |
👋 Hey Friends, this issue has been automatically marked as |
Consider this scenario:
I want to be able to query the Events API for the events which happened while my web service was down, so that I can replay them. However, I want to do this efficiently, and only query for events in a given repo if new ones have been added. Before my service shuts down, it could save the last ETag returned by the Events API endpoint. When it comes back up, it could read this saved value and initialize the Octokit Events client so that it would make requests with the saved ETag.
Very easy thing to do and could potentially be quite useful!
The text was updated successfully, but these errors were encountered: