What is the problem?
If in the expiry input you enter a very large number you can get an exception like:
[Z45wZNLYBY1ztyb62UuKdwAAABA] Exception caught: Wikimedia\Timestamp\ConvertibleTimestamp::setTimestamp: Invalid timestamp - 360253372459734
It happens if you enter 999999999999999 hours as a custom duration. If you enter a larger number, like 9999999999999999999999999 you instead see the error Expiry time invalid.
This bug also effects OOUI Special:Block.
Steps to reproduce problem
- Special:Block
- Enter a target, click Add block or Edit
- In the expiration input, select the Custom duration radio
- In the numeric input, enter 999999999999999
- Submit
Expected behaviour: Either it submits correctly or you get an error of the form Expiry time invalid.
Observed behaviour: The above exception.
Environment
Operating system:
Browser:
Wiki(s):
Editor:
Screenshots
Derived Requirement
Ensure that the Special:Block page handles extremely large numeric inputs in the "Custom duration" field gracefully, either by rejecting them with a user-friendly error message (e.g., "Expiry time invalid") or by processing them correctly without throwing an exception.
Test Steps
Test Case 1: Handle Extremely Large Numeric Input in Custom Duration Field
- Navigate to the Special:Block page.
- Enter a target username in the "Block this user" field.
- Click "Add block" or "Edit."
- Select the "Custom duration" radio button.
- In the numeric input field, enter 999999999999999.
- Submit the form.
- ✅ AC1: Verify that the system either processes the input correctly or displays a user-friendly error message (e.g., "Expiry time invalid") without throwing an exception.
Test Case 2: Handle Extremely Large Invalid Numeric Input in Custom Duration Field
- Navigate to the Special:Block page.
- Enter a target username in the "Block this user" field.
- Click "Add block" or "Edit."
- Select the "Custom duration" radio button.
- In the numeric input field, enter 9999999999999999999999999.
- Submit the form.
- ✅ AC2: Verify that the system displays a user-friendly error message (e.g., "Expiry time invalid") without throwing an exception.
QA Results - Test Wiki
AC | Status | Details |
---|---|---|
1 | ✅ | T384241#10521887 |
2 | ✅ | T384241#10521887 |