Fix #5681: improved fallback when missing faces.ajax.addOnError handler#5682
Fix #5681: improved fallback when missing faces.ajax.addOnError handler#5682
Conversation
|
This is better, but I do not think this is enough.
The problem that prompted the issue is actual users complaining. The users are on mobile phones. Thus, my suggestion is to reload the same page by default in production mode. This is when actual feedback can be given to actual users, instead of no feedback at all, which is the worst possible behavior IMHO |
|
It's the developer's responsibility to implement faces.ajax.addOnError conform business requirements, not the framework's. Note that ExceptionHandler has same issue. There's nothing in prod stage. If we change this then ExceptionHandler also needs change. And possibly many other things which only appear in dev stage. I'd rather not start this here. Also note that this dev-stage-only alert is part of the spec: https://jakarta.ee/specifications/faces/4.0/jakarta-faces-4.0#a6806
|
Agree.
There is a big difference here. Server-side exceptions can be seen in production logs, debugged, etc. |
|
The improvement in current PR should prevent/reduce that in the future. |
|
Yes, I agree it's better, but still the mobile phone case if not handled, since console errors cannot be seen on the phone. This is especially true when testing is done in the development mode, and production is obviously in "production" mode where the issue rears its ugly head :) |
|
You can decorate console.error to trigger a REST endpoint which captures and logs the message in server side. It'll solve many more mysteries than only a missing faces.ajax.addOnError. |
|
True, but it will slow down the app... especially on mobile. Not sure it's a good solution :) |
|
It'll only slow down if your app spits extremely a lot of console.error lines. Even then you can still send with delay and reset delay when a new line is added. It's not impossible and definitely super helpful. You'll see :) |
|
Agreed, but I think redirect-to-self is the most sensible and simplest option :) |
|
Then implement your faces.ajax.addOnError accordingly. |
|
Of course, but I am trying to argue for the most sensible default here. Not everyone has the time to debug this stuff :) |
monitoring (e.g NewRelic, Sentry, etc) will be invoked
|
Ok, at least this can be caught more easily this way |
|
I added a check+trigger on window.onerror so any 3rd party monitoring tool is at least aware. |
#5681
previously:
now: