Page 1 of 1

New Input Box on Rules Page?

Posted: 17 Dec 2019, 20:22
by ThomasB
I noticed a new feature on the latest Mega PR (mega-20191208). It's a Input entry box at the bottom of the Rules Editor page. See red arrow in the photo below:

esp_mystery.jpg
esp_mystery.jpg (153.47 KiB) Viewed 4203 times

The entry defaults to zero. But when the rule page is submitted it briefly flashes a numerical value that is slightly smaller than the actual length of the rules file.

I checked the source code and see that it allows changing the rules file length. Curious about it, I played around a bit. If I enter a value that is equal (or less than) the known file length the page submission is successful. If I enter a larger value the page reports Error: Data not saved.

I've been scratching my head trying to find the reason for this entry area. No mention of it in the release notes; Perhaps Gijs (@TD-er) added it for his rules debugging? Or is it a cool new unadvertised feature?

- Thomas

Re: New Input Box on Rules Page?

Posted: 18 Dec 2019, 03:10
by grovkillen
It's for Gijs tests. So no new feature, sorry ;)

Re: New Input Box on Rules Page?

Posted: 18 Dec 2019, 03:19
by ThomasB
@grovkillen, Thanks for the info on the mystery box.
- Thomas

Re: New Input Box on Rules Page?

Posted: 18 Dec 2019, 09:47
by TD-er
It should not be visible.

It is part test, part a "hidden" helper (supposed to be hidden), to have an extra forms parameter to help detect what rules size was submitted.
The problem is that sometimes the rules get truncated, due to a bug in the WebServer library code.
So I added a little JavaScript to give the length of the submitted rules before sending out the submit.
So if you see it update the field you either have lightning fast visual processing powers, or need a faster computer ;)
It was way easier to add a field in the form than to make the JavaScript append some parameter to the POST.