Page MenuHomePhabricator

Move cookie-related logic from User and Block to BlockManager
Closed, ResolvedPublic

Description

Move these methods to BlockManager:

  • User::trackBlockWithCookie
  • DatabaseBlock::setCookie
  • DatabaseBlock::clearCookie
  • DatabaseBlock::getCookieValue
  • DatabaseBlock::getIdFromCookieValue
  • AbstractBlock::shouldTrackWithCookie

We could alternatively make a small, separate service for this.

Event Timeline

Change 514843 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] WIP Move cookie-blocking methods to BlockManager

https://gerrit.wikimedia.org/r/514843

@dmaza, @dbarratt and I have discussed separating the cookie blocking service from the BlockManager. @daniel do you have an opinion on this?

Change 514843 merged by jenkins-bot:
[mediawiki/core@master] Move cookie-blocking methods to BlockManager

https://gerrit.wikimedia.org/r/514843

dom_walden added a subscriber: dom_walden.

Testing IP and Autoblock cookies locally, looking at:
+ Does the cookie get set at the right time?
+ Do the cookies get cleared at the right time?
+ Is the block applied correctly from the cookie?

Comparing the behaviour to beta and test wiki when I have been unsure.

When testing T206163 on beta, I have included cookie blocks in combination with other blocks. Seeing that the behaviour seems reasonable.

Nothing jumped out to me as a problem.