-
Problem report
-
Resolution: Unresolved
-
Trivial
-
7.0.10, 7.2.3, 7.4.0alpha2 (master)
-
Sprint candidates
Using just API, "every" field in maintenance.create or maintenance.update can range from 1 to 2147483647. The define used in API validation is ZBX_MAX_INT32. It's not even ZBX_MAX_DATE which would be more accurate. This number is just too large to comprehend. It's more than 400K centuries. Also for API it doesn't matter if it's a daily or weekly maintenance.
However in frontend maximum values for "every" field are hard-coded numbers like 99 or 999 depending on whether it is a daily or weekly maintenance. 999 days is ~1.9 years, but 99 weeks is ~2.7 years. So the difference here is also quite significant.
Creating a maintenance period of every 1000 days cannot be updated in frontend. Though it can be opened and changed, at least.
We shouldn't limit the user too much, but also shouldn't grant too much freedom entering any value withing the range 1-2147483647. That's too much. We should create more reasonable constants for time periods and synchronize the API and frontend validation.