Closed
Description
@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
Labels
No labels