tedious/Stash

Maintenance release 0.14.2 broke our use

alexbowers opened this issue · 10 comments

I haven't had the chance to look into it yet, but upgrading to 0.14.2 broke our system, downgrading to 0.14.1 works.

It seems to stem from the response not always having values, especially if they have just been set.

Some further research required, which I currently don't have the time to do, but just a heads up, the maintenance release may be a critical breaking change.

Our setup uses redis:

$driver = new Redis([
    'servers' => [
        [   
            'server' => $options['redis_ip'],
            'port' => $options['redis_port'],
            'ttl' => $options['redis_timeout'],
        ]
    ],
    'password' => $options['redis_password'],
    'database' => 1,
]);

$this->pool = new Pool();
$this->pool->setDriver($driver);
$this->pool->setNamespace($options['namespace']);

$cache_instance = CacheRepository::getInstance();
$pool = $cache_instance->pool;
$item = $pool->getItem(Settings::$cache_keys['admin_all']);

if ($item->isMiss()) {
    $settings = Settings::all(['fields' => ['name', 'value'], 'conditions' => ['deleted' => 0]]);
    $pool->save($item->set($settings->data(), CacheRepository::MONTH));
}

$settings = $item->get();
Array
(
    [driver] => redis
    [file_cache_path] => /var/www/sites/current/xxx/app/resources/tmp/cache/stash/
    [redis_ip] => 127.0.0.1
    [redis_port] => 6379
    [redis_password] => vagrant
    [redis_timeout] => 2
    [namespace] => merchant4
)

@alexbowers - if you want to push out a revert release I'd approve of that. We can then push out this change as 0.15, or wait until the issue has been found and resolved.

@tedivm Unfortunately, I do not know how to revert a release.

Do you have any idea how I would go about doing that?

Find the commit from the tag you want to go to (v0.14.1) and then make a new tag from that commit-

git tag -a v1.2 9fceb02 -m "Message here"

https://stackoverflow.com/questions/4404172/how-to-tag-an-older-commit-in-git

Once the tag is up it'll get picked up by packagist.

Same problem.

->save('data'); then ->get(); will return always null;

Sorry, I don't understand what you want. What does mean "bisect"? Detect?
I'm Russian, English is not my own language.

Now I just set version 0.14.1 in composer.json
When it switch to 0.14.2 - then brokes.

You can test it very easy:

$driver = new Ephemeral();
$pool = new Pool($driver);
$cache = $pool->getItem('some/item/name');
$cache->get(); // null
$cache->set('some value');
$cache->expiresAfter(3600);
$cache->save();
$cache->get(); // null on 14.2 and 'some value' in 14.1

I'll try to have another look this evening.

To clarify, bisect is a command in git, which allows you to track down bugs.

It's worth looking into, it's definitely worth learning for future https://git-scm.com/docs/git-bisect

Oh, I got it, thanks.
I'll try little later.