You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requests are being cached incorrectly, so that API calls to get a users repo are now returning cached results from the wrong user. I am rolling back to the previous version immediately.
That's because the caching of requests was broken in previous versions. All requests with the private or no-cache directive were skipped by the cache plugin. So no github api request could be cached
You can fix this for now by passing this option to the cache plugin. Example from the docs:
useCache\Adapter\Redis\RedisCachePool;
$client = new \Redis();
$client->connect('127.0.0.1', 6379);
// Create a PSR6 cache pool$pool = newRedisCachePool($client);
$client = new \Github\Client();
$option = [ 'respect_response_cache_directives' => ['no-cache', 'private', 'max-age', 'no-store']];
$client->addCache($pool, $options);
Surely this still won't fix everything. Shouldn't the caching have only been etag based, why on earth would we provide a correct etag, and then fetch the wrong cache response?
Activity
acrobat commentedon Mar 31, 2017
I think the generated cache key is to general. See https://github.com/php-http/cache-plugin/blob/master/src/CachePlugin.php#L290
If the request parameters are included the key will be unique enough I think
Thoughts on this @Nyholm?
GrahamCampbell commentedon Mar 31, 2017
This is only in the very latest update. No such bug occurred 7 days ago.
acrobat commentedon Mar 31, 2017
That's because the caching of requests was broken in previous versions. All requests with the private or no-cache directive were skipped by the cache plugin. So no github api request could be cached
You can fix this for now by passing this option to the cache plugin. Example from the docs:
acrobat commentedon Mar 31, 2017
@GrahamCampbell Can you provide some example call which fails when using the cache? So I can check how to fix this
Nyholm commentedon Mar 31, 2017
Thank you for reporting this. I will make a PR.
Nyholm commentedon Apr 5, 2017
I've added #558. Please review it.
We are just waiting for a new tag on the CachePlugin.
GrahamCampbell commentedon Apr 5, 2017
Also, the current version of this package is throwing a deprecation error, even know I'm not using a deprecated feature?
GrahamCampbell commentedon Apr 5, 2017
https://github.com/GrahamCampbell/Laravel-GitHub/blob/master/src/GitHubFactory.php#L86
Nyholm commentedon Apr 5, 2017
From where?
GrahamCampbell commentedon Apr 5, 2017
It's because you set a deprecated default: https://github.com/php-http/cache-plugin/blob/v1.3.0/src/CachePlugin.php#L336.
GrahamCampbell commentedon Apr 5, 2017
Surely this still won't fix everything. Shouldn't the caching have only been etag based, why on earth would we provide a correct etag, and then fetch the wrong cache response?