colinmollenhour / php-redis-session-abstract

A Redis-backed PHP session handler with optimistic locking
Other
59 stars 46 forks source link

1.6.0 contains breaking changes #58

Closed fascinosum closed 4 months ago

fascinosum commented 4 months ago

Hello,

A new minor release of the project contains a breaking change to the interface that, according to Semantic Versioning, should result in a new major release. This breaking change significantly affects other open-source projects, such as Magento OS, which has thousands of users @colinmollenhour, could you kindly consider reverting the change to the interface and releasing a new patch version for 1.6.*?

Thank you, @colinmollenhour, and all contributors of the project for your hard work!

hostep commented 4 months ago

Indeed, I agree

In M2, we now get this when running bin/magento setup:di:compile:

PHP Fatal error:  Class Magento\Framework\Session\SaveHandler\Redis\Config contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Cm\RedisSession\Handler\ConfigInterface::getRetries) in vendor/magento/framework/Session/SaveHandler/Redis/Config.php on line 16

Fatal error: Class Magento\Framework\Session\SaveHandler\Redis\Config contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Cm\RedisSession\Handler\ConfigInterface::getRetries) in vendor/magento/framework/Session/SaveHandler/Redis/Config.php on line 16

Because https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/Session/SaveHandler/Redis/Config.php implements the interface which was now changed in 1.6.0, so this breaks.

Preferable this change should be reverted, 1.6.1 should be tagged and the change should be included in a new major version 2.0.0 (or alternatively the change should be implemented differently without changing the interface if possible)

This only breaks in Magento 2.4.6 and 2.4.7 versions, because before 2.4.6 we had a composer constraint using ~1.4.5 and with 2.4.6, the constraint changed for some reason to ^1.4 (over here)

cmuench commented 4 months ago

It's breaking Magento 2.4.6-p5 as welll. For reference: https://github.com/netz98/n98-magerun2/actions/runs/9119272478/job/25087515280

Maybe this change should be tagged as v2.0.0.

colinmollenhour commented 4 months ago

Yikes, sorry for the trouble, guys! I looked at the M2 composer.json and it had the version as "^1.5" and I thought that meant ">=1.5.0 <1.6.0" but apparently it means ">=1.5.0 <2.0.0".. I will move this change to 2.0

colinmollenhour commented 4 months ago

I released the latest master as v2.0.0 and the previous v1.5.5 as v1.7 so I believe that should effectively "roll back" the v1.6.0 release.

hostep commented 4 months ago

Thank you very much for the quick fix Colin! And don't worry too much about the mistake, we're only human after all 🙂