Skip to content

[Caching] Fix caching on change config cache not cleared#3479

Closed
samsonasik wants to merge 1 commit intomainfrom
caching-fix-change-config-cached
Closed

[Caching] Fix caching on change config cache not cleared#3479
samsonasik wants to merge 1 commit intomainfrom
caching-fix-change-config-cached

Conversation

@samsonasik
Copy link
Copy Markdown
Member

@jackbentley this should fix rectorphp/rector#7835.

The invalidateCacheIfConfigurationChanged() is called before save(), so before save(), if it still null, the cache data need to be cleared to ensure no left over cache

$this->invalidateCacheIfConfigurationChanged($key, $configurationHash);
$this->cache->save($key, CacheKey::CONFIGURATION_HASH_KEY, $configurationHash);

@samsonasik
Copy link
Copy Markdown
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@samsonasik
Copy link
Copy Markdown
Member Author

@jackbentley the issue seems due to sha1_file() usage, which on lookup root rector.php, it got overlapped relative and absolute path, I will create alternative separate PR to use normal sha1() to ensure it works on both relative and absolute path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File passes after config cache when it should fail because of cache

1 participant