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

Tchanders created this task.Jun 5 2019, 7:24 PM
Restricted Application added a subscriber: MGChecker. · View Herald TranscriptJun 5 2019, 7:24 PM

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?

Tchanders moved this task from Ready to Review on the Anti-Harassment (Lāmed - ל) board.

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.

dbarratt closed this task as Resolved.Jun 18 2019, 4:11 PM