Page MenuHomePhabricator

Start date/time of composite block is always current date/time
Closed, ResolvedPublic3 Estimated Story PointsBUG REPORT

Description

What is the problem?

If I am blocked by 2 or more different blocks, when viewing the block message the Start of block is always the current date and time.

This probably isn't very useful. Perhaps instead it should be the start time of the earliest block.

Steps to reproduce problem
  1. Block your user or IP with 2 blocks (e.g. use Special:Block to create a block against your account and a block against your IP)
  2. Wait a few minutes (you want to be able to distinguish between the current time and the time you created the blocks in step 1)
  3. Attempt to edit a page
  4. You should see a block message with something like Start of block
  5. Compare this to the Timestamp column in Special:BlockList

Expected behavior: The start time in the block message should be the same as the Timestamp column (for at least one of the blocks you made in step 1).
Observed behavior: The start date and time is the current time. If you wait and refresh the page the start time changes.

Environment

Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.40.0-alpha (9e4457f) 07:11, 15 November 2022.

QA Results -Local

Event Timeline

AGueyte set the point value for this task to 3.

I have reproduced the steps by creating 2 blocks against a user (username + IP) and do get the right Start Time and End Time from the Special:BlockList and the Block message

Screenshot 2023-07-11 at 10.20.45 AM.png (886×1 px, 220 KB)

Screenshot 2023-07-11 at 10.20.28 AM.png (682×1 px, 152 KB)

Created a third block against my local IP (partial block from editing a specific page) and was still getting the correct start/end time for both Temp Users and logged out user.

Screenshot 2023-07-11 at 10.24.44 AM.png (894×2 px, 324 KB)

Screenshot 2023-07-11 at 10.25.18 AM.png (1×1 px, 224 KB)

Screenshot 2023-07-11 at 10.25.37 AM.png (876×1 px, 207 KB)

I conclude this bug has been eventually fixed along the way.

@AGueyte @TThoabala From the screenshots, I'm seeing:

  • Start of block 12.47 in the message about the temporary user block, and in Special:BlockList
  • Start of block 12.55 in the message about the composite block (final screenshot)

Is that not the bug?

@AGueyte @TThoabala From the screenshots, I'm seeing:

  • Start of block 12.47 in the message about the temporary user block, and in Special:BlockList
  • Start of block 12.55 in the message about the composite block (final screenshot)

Is that not the bug?

From my understanding, the start of the block in 12.47 is towards the Temp users which shows also at 12.47 (screenshot #5)

The existing block against the local IP is starting at 12.55 and showing for an unlogged user at 12.55 (screenshot #6)

That seems correct to me?

The existing block against the local IP is starting at 12.55 and showing for an unlogged user at 12.55 (screenshot #6)

This block starts at 12.54, according to Special:BlockList

Presumably the composite block is showing a start time of 12.55 because the edit was attempted 1 minute later?

Change 949213 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/core@master] Fix composite block start time

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

AGueyte changed the point value for this task from 1 to 2.Aug 17 2023, 10:50 AM

Change 951520 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/core@master] CompositeBlockTest: Add test for getting earliest timestamp

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

Change 951103 had a related patch set uploaded (by AGueyte; author: AGueyte):

[mediawiki/core@master] Update AbstractBlock functions with timestamp value

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

AGueyte changed the point value for this task from 2 to 3.Aug 28 2023, 2:12 PM

Change 951103 abandoned by AGueyte:

[mediawiki/core@master] Update AbstractBlock functions with timestamp value

Reason:

Not needed

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

Change 951520 abandoned by Tchanders:

[mediawiki/core@master] CompositeBlockTest: Add test for getting earliest timestamp

Reason:

Added to I29b9f4ba84ee760425cc9ba3a1c58ed22e889d86 instead

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

Change 949213 merged by jenkins-bot:

[mediawiki/core@master] Fix composite block start time

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

To test this patch, first have an open session from a temporary user (create a new one or use the actual one).
Create 2 blocks: once against a temporary user, and a second one for an IP used by this temporary user.
Delay the block creation by a few minutes to see two different times.

Wait a few minutes and try to edit a page, or any blocked activity (for partial blocks) while still being logged as the now-blocked temporary user.

The start time of the block should be the time of the first block against the user, meaning, the earliest block against the user.

You can try to create 'System Blocks' against that same IP user by adding the values in your LocalSettings:
$wgSoftBlockRanges = [ '103.130.145.255' ]; (add the blocked IP in here)

GMikesell-WMF subscribed.

@AGueyte The start time in the block message is the same as the Timestamp column. The task will be moved to Done. Thanks for all your work!

Status: ✅ PASS
Environment: Local 1.41.0-alpha (bc735a5) 14:54, 30 August 2023
OS: macOS Ventura
Browser: Chrome 116
Device: MBP
Emulated Device:: N/A
Test Links:
http://localhost:8080/w/index.php?title=Dog&action=edit
http://localhost:8080/w/index.php?title=Beer&action=edit

✅AC1: The start time in the block message is the same as the Timestamp column
Special:Blocks

2023-08-30_12-26-51.png (1×1 px, 249 KB)
2023-09-05_08-45-58.png (1×1 px, 229 KB)

Special:BlockList

2023-09-05_09-49-43.png (1×3 px, 286 KB)

Message Results

2023-09-05_09-50-47.png (1×3 px, 511 KB)
2023-09-05_09-51-19.png (1×3 px, 281 KB)
Aklapper added a subscriber: AGueyte.

Removing inactive task assignee (please do so as part of offboarding steps).

Pppery assigned this task to AGueyte.