+
Skip to content

Weird caching issue with our new _request implementation #14

Closed
@michael

Description

@michael

@mattpass we've got a crazy crazy caching problem with our current XMLHttpRequest native implementation. I couldn't find out what's exactly happening here.

You need to use the updated github.js that I haven't commited yet because of this bug:

https://gist.github.com/3196019

The error can be reproduced like so:

var repo = github.getRepo("michael", "cmake_cdt7_stalled");

// Triggers GET: https://api.github.com/repos/michael/cmake_cdt7_stalled/git/refs/heads/prose-integration
repo.getRef('obu_cdt7_support', function(err, ref) {
  // Triggers DELETE: https://api.github.com/repos/michael/cmake_cdt7_stalled/git/refs/heads/prose-integration
  repo.deleteRef("heads/obu_cdt7_support", function(err) {
    // For some weired reason the delete request doesn't get started, request inspection in chrome reveals
    // it just returns the content from the previous GET request (from cache)
  });
});

That's what the request log looks like for the DELETE request. Expected is a 204 no-content (not from cache) that actually removes the ref but we get a 200 OK (from cache). Seems like the variation of the method (GET vs. DELETE) is not considered for the caching mechanism.

Request URL:https://api.github.com/repos/michael/cmake_cdt7_stalled/git/refs/heads/prose-integration
Request Method:DELETE
Status Code:200 OK (from cache)
Request Payload
{"user":"michael","name":"cmake_cdt7_stalled"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载