Bug?: Can't edit aliases

Started by waxhead, January 30, 2021, 03:10:18 PM

Previous topic - Next topic
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?

In my context, editing alias works normally.
System 1: PC Engines APU2C4
System 2: PC Engines APU2E4
System 3: Proxmox-VM on Intel NUC

Looks good on my end as well. Do you maybe have a JavaScript error in the developer console?


Cheers,
Franco

January 31, 2021, 02:59:53 AM #3 Last Edit: January 31, 2021, 03:02:18 AM by youngman
Quote from: waxhead on January 30, 2021, 03:10:18 PM
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"

Quote from: 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
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

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

PS: Number is not a secret for pretty clever reasons but it also doesn't matter here. ;)

Quote from: 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

Appreciate that. Looking forward to the point release then!

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

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

February 03, 2021, 09:21:56 AM #10 Last Edit: February 03, 2021, 09:36:14 AM by youngman
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

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

February 05, 2021, 06:00:22 PM #12 Last Edit: February 05, 2021, 06:02:35 PM by waxhead
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 ;)

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

February 06, 2021, 04:57:23 PM #14 Last Edit: February 06, 2021, 05:12:59 PM by marjohn56
Quote from: waxhead on February 05, 2021, 06:00:22 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.
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member