Add cache buster to all GitHub API calls #449
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should solve issues like #308 and the issues with cached
API responses after deleting an entry
- Summary
GitHub's API does fairly aggressive caching for GET requests, at this causes problems in several cases. Especially when creating commit trees where a stale response from the GitHub API can make us try to base the changes on a wrong SHA and lead to issues like #308
This also caused problem for the work on deleting entries, since we would get a stale folder list right after entry deletion.
This PR takes the brute force approach of adding a cache buster timestamp as a query parameter to all GitHub API requests.
- Test plan
Warning - I haven't tested this yet. The old Ember prototype had a similar cache buster approach (though only on some requests) so I'm fairly confident in the solution. An alternative approach would be to only set the cache buster parameter for get requests that MUST be uncached.
- Description for the changelog
Fix stale reads from GitHub's API
- A picture of a cute animal (not mandatory but encouraged)