OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: waxhead on January 30, 2021, 03:10:18 pm

Title: Bug?: Can't edit aliases
Post by: waxhead on January 30, 2021, 03:10:18 pm
Apparently I am not able to edit aliases by clicking the pen like button (Firewall->Aliases->existing alias->pen icon)

I tried in two different browsers , SeaMonkey 2.54 (daily driver) and Chromium v83 with the same result. Also ran System->Firmware->Updates->Audit->Health which I assume checks that all files are ok and don't have checksum errors...
I tested this with both the tukan theme (which I use by default) and the OPNsensedefault theme.

Is it just me or do others have this problem as well?
Title: Re: Bug?: Can't edit aliases
Post by: thowe on January 30, 2021, 03:44:07 pm
In my context, editing alias works normally.
Title: Re: Bug?: Can't edit aliases
Post by: franco on January 30, 2021, 07:59:04 pm
Looks good on my end as well. Do you maybe have a JavaScript error in the developer console?


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: youngman on January 31, 2021, 02:59:53 am
Is it just me or do others have this problem as well?

I have it too. Firefox via openSUSE, default OPNsense theme. Clicking the 'pen icon' is unresponsive...

Console error reads "TypeError: string.replaceAll is not a function"
Title: Re: Bug?: Can't edit aliases
Post by: waxhead on January 31, 2021, 03:14:18 am
Looks good on my end as well. Do you maybe have a JavaScript error in the developer console?


Cheers,
Franco
Yes, I get this:
Error: TypeError: string.replaceAll is not a function
Source File: https://cencored/ui/js/tokenize2.js?v=(somehexnumber that perhaps should be secret)[
Line: 1033
Title: Re: Bug?: Can't edit aliases
Post by: franco on January 31, 2021, 11:09:01 am
Tokenize 1.3.3 update added string.replaceAll use apparently https://github.com/opnsense/core/commit/4035a2f9552a

We will try to work around it if feasible for 21.1.1.


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: franco on January 31, 2021, 11:11:23 am
PS: Number is not a secret for pretty clever reasons but it also doesn't matter here. ;)
Title: Re: Bug?: Can't edit aliases
Post by: waxhead on January 31, 2021, 06:29:15 pm
Tokenize 1.3.3 update added string.replaceAll use apparently https://github.com/opnsense/core/commit/4035a2f9552a

We will try to work around it if feasible for 21.1.1.


Cheers,
Franco

Appreciate that. Looking forward to the point release then!
Title: Re: Bug?: Can't edit aliases
Post by: franco on February 01, 2021, 11:51:49 am
Hmm, this function is relatively new, but since upstream Tokenizer added it we are unsure if we should do anything. Here is the compatibility list...

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll#browser_compatibility


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: franco on February 01, 2021, 12:12:47 pm
Some back and forth, now we try polyfill for this https://github.com/opnsense/core/commit/87c00de215

# opnsense-patch 87c00de215

Does this work for you?


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: youngman on February 03, 2021, 09:21:56 am
Thanks Franco,

Confirmed patch functional on Firefox 68.9.0esr (64-bit) & Chromium 83.0.4103.97 (openSUSE Build) (64-bit).

Edit: And having realised how out of date the standard packages are... after updating can confim also working on Firefox 78.7.0esr (64-bit) & Chromium 88.0.4324.96 (openSUSE Build) (64-bit).

Cheers,
Guv
Title: Re: Bug?: Can't edit aliases
Post by: franco on February 03, 2021, 09:41:32 am
Hi Guv,

Thanks a lot for testing. Only had a tentative ok on this patch from one other person... I'll make sure it lands in 21.1.1.

And yes, browsers are being outdated very fast these days and sometimes that makes support very difficult. ;(


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: waxhead on February 05, 2021, 06:00:22 pm
Thanks for patching this bug / incompatibility. I think that one should strive to stay compatible with older browsers - it is "only" a GUI and I can imagine that where stable systems is preferred there might be an outdated browser or two in use.

Be warned - slight rant....:
In general I hate animations, effects and "fancy stuff" on web-gui's especially. It is supposed to be functional, fast and not a tech demo. Lots of modern websites seem to have forgotten this.

The biggest issues I have with OPNsense (except this little nugget of entertainment reported here) is that the web-gui is dead slow. At least on my system with an "outdated" bowser (SeaMonkey V2.53.6 January 22 - 2021) that runs on a 2007 era Core 2 Duo E6600. While OPNsense is great, I am to this day surprised that the GUI - which is a fairly new invention - is as slow as it is.

Now, sorry if I am a bit harsh - I am not trying to bash OPNsense here, but one of the reasons that I "tipped over" to try out OPNsense was the GUI. While I dislike the white theme, the (at that time) aim to structure it better, plus the nice help easily accessible was the carrot for me. Not only for me , but probably for others as well I would think that little things like this - including the bug/incompatibility mentioned here can easily be a trigger for rejecting a product - so if I may again - please test and make sure basics work on older browsers as well. I was trying to adjust something in the captive portal yesterday, but refused to try another browser , so I just decided to wait until the next update ;)
Title: Re: Bug?: Can't edit aliases
Post by: franco on February 06, 2021, 04:23:41 pm
Hi waxhead,

With a decade of building firewalls, network appliances and their GUIs my personal and professional experience differs from your views, but that is besides the point.

The error was introduced in the Tokenize2 JS library moving it from version 1.3 to 1.3.3.

1.3 was released in 2018 and didn't have replaceAll JS because browsers didn't know about it.

https://github.com/dragonofmercy/Tokenize2/releases/tag/1.3

Version 1.3.3 was released in late 2020 when browsers barely supported replaceAll function.

https://github.com/dragonofmercy/Tokenize2/releases/tag/1.3.3

The question is how do we deal with reliability updates if the upstream maintainers have no focus on a particular area that we now are supposed to specialise at?

What's more interesting is that if you look for replaceAll in the issue tracker nobody raised a bug there...

https://github.com/dragonofmercy/Tokenize2/issues?q=replaceAll

So the question is if the maintainer has no reason to fix it because there are no users of the library or at least its newer versions or no users with the issue... are downstream maintainers in the situation to fix the library or provide polyfills for older browsers and if so can you really ask for advance polyfill to not break older browsers? :)

From 21.1 to 21.1.1 it's not far so from dev perspective we did all we can when we could, but there is room to disagree there perhaps.


Cheers,
Franco
Title: Re: Bug?: Can't edit aliases
Post by: marjohn56 on February 06, 2021, 04:57:23 pm

Now, sorry if I am a bit harsh - I am not trying to bash OPNsense here, but one of the reasons that I "tipped over" to try out OPNsense was the GUI. While I dislike the white theme, the (at that time) aim to structure it better, plus the nice help easily accessible was the carrot for me. Not only for me , but probably for others as well I would think that little things like this - including the bug/incompatibility mentioned here can easily be a trigger for rejecting a product - so if I may again - please test and make sure basics work on older browsers as well. I was trying to adjust something in the captive portal yesterday, but refused to try another browser , so I just decided to wait until the next update ;)

Probably doesn't work at all on windows 95 then, also I cannot drive my car on leaded fuel. I have a lot of clients who are going to be extremely upset when they go back their offices ( eventually ) and find that their nice GUIs which used flash are no longer going to work, progress sucks! : ;)

Several choices of themes now to play with.
Title: Re: Bug?: Can't edit aliases
Post by: waxhead on February 06, 2021, 05:34:30 pm
Probably doesn't work at all on windows 95 then, also I cannot drive my car on leaded fuel. I have a lot of clients who are going to be extremely upset when they go back their offices ( eventually ) and find that their nice GUIs which used flash are no longer going to work, progress sucks! : ;)

Several choices of themes now to play with.

Yeah there are good themes such as the tukan theme which I use to make things a bit more visible. For me this works better than the default.

Regarding the rest of your comment - do you see the irony in your own argument here? What you are describing is exactly what I am advocating against. You joke about people getting upset when their flash based GUI don't work anymore. This is precisely my point.

More often than not dependencies are evil, horrible and make you smell funny too, and you should avoid them as much as possible, when possible, if possible. At some point your fancy library that promised you everlasting love suddenly hates you and things you depended on is no longer supported or wrecks compatibility. A web GUI should be as simple as possible, preferably even without javascript with the odd exception of updating a div every now and then. So in my little playworld I would rather say that progress in this particular case would be no need for dependencies.
Title: Re: Bug?: Can't edit aliases
Post by: chemlud on February 06, 2021, 05:43:31 pm
Yeah there are good themes such as the tukan theme which I use to make things a bit more visible. For me this works better than the default.

Regarding the rest of your comment - do you see the irony in your own argument here? What you are describing is exactly what I am advocating against. You joke about people getting upset when their flash based GUI don't work anymore. This is precisely my point.

More often than not dependencies are evil, horrible and make you smell funny too, and you should avoid them as much as possible, when possible, if possible. At some point your fancy library that promised you everlasting love suddenly hates you and things you depended on is no longer supported or wrecks compatibility. A web GUI should be as simple as possible, preferably even without javascript with the odd exception of updating a div every now and then. So in my little playworld I would rather say that progress in this particular case would be no need for dependencies.

Forget it, this war is long lost. They run "security appliances" as virtual machines on hardware nobody can control. Go home, make peace, everything is broken. Literally...
Title: Re: Bug?: Can't edit aliases
Post by: marjohn56 on February 06, 2021, 05:45:11 pm
You misunderstand, I was being ironic. I have zero issues with obsolescence,  I will always be amongst the first in the queue to update, however there is the the expression 'If it ain't broke, don't fix it'.


As far as HTML is concerned there have been and will continue to be changes made that make older browsers break, it's the nature of the beast. I use Chrome & Edge both which update automatically. I also have Firefox, which is there but I rarely use. Would I use IE? Not likely.


Technology moves on and so must we. As for my clients, they'll have to update their systems; in the context of flash it was insecure anyway so it's a good thing, also good as they'll need to dip into their pockets.  8)
Title: Re: Bug?: Can't edit aliases
Post by: aimdev on February 06, 2021, 07:15:09 pm
Apparently I am not able to edit aliases by clicking the pen like button (Firewall->Aliases->existing alias->pen icon)

I tried in two different browsers , SeaMonkey 2.54 (daily driver) and Chromium v83 with the same result. Also ran System->Firmware->Updates->Audit->Health which I assume checks that all files are ok and don't have checksum errors...
I tested this with both the tukan theme (which I use by default) and the OPNsensedefault theme.

Is it just me or do others have this problem as well?

Just edited an alias, no problems.
Title: Re: Bug?: Can't edit aliases
Post by: waxhead on February 09, 2021, 10:40:23 pm
Tokenize 1.3.3 update added string.replaceAll use apparently https://github.com/opnsense/core/commit/4035a2f9552a

We will try to work around it if feasible for 21.1.1.


Cheers,
Franco

Did a quick test and the workaround seems to work perfectly (so far). Thanks a bunch!