Comments (14)
I guess the element is null here somehow
from blazorise.
Possible a race condition here when disposing/navigating away.
from blazorise.
We would probably need to add a null check on a bunch of places.
from blazorise.
Yep as we've seen most of the js exceptions are just race conditions where the element has disappeared when something was about to be invoked.
Again I'd probably not only add the null check but also the try/catch all we've talked about on some other thread. I know try/catching all might seem not like a good idea, but realistically do we ever want to stop an user's application with one of these js exceptions?
from blazorise.
biggest issue with these unhandled JSExceptions is that the CircuitHost dies and you loose your Blazor server session forcing the user to reload the page
from blazorise.
@David-Moreira Please try it for the coming 1.6 release. I would not change it too much in 1.5.
from blazorise.
I'd enable this by default and introduce a Blazorise option to be able to turn it off. I don't think a user will ever want to turn it off, but just in case... Agree?
Something like SafeJsInvoke //Whether to safely invoke internal javascript. Will ignore any exceptions that might be thrown as part of the javascript invoke process.
from blazorise.
Hmm. Can you explain how that will look in the code? Pseudo code is good.
from blazorise.
What do you mean?
It's an option, it either calls the current version or it calls the try catch all version.
if (safejsinvoke)
InvokeSafe();
else
InvokeWhateverWeHaveNow();
I'm not very familiar with the internals of our js invokes, so only when I start working will I see if there's any technical difficulty, but I don't expect any, it should be like that, the most centralized we can make it.
from blazorise.
Yes, but we already have InvokeSafeVoidAsync
and InvokeSafeAsync
, which should be safe already. That is why I'm confused about why we need an extra layer of "safe".
from blazorise.
Does this seem safe to you? hehe
from blazorise.
Whatever "safe" approach we have currently, is not safe in the manner that you can actually call it and trust that you won't have an exception.
from blazorise.
Haha, absolutely not. Just have a quick prototype in a few places and create a draft PR so that we can see how it looks. Making it optional is also a good idea, as you said.
from blazorise.
Haha, absolutely not. Just have a quick prototype in a few places and create a draft PR so that we can see how it looks. Making it optional is also a good idea, as you said.
Haha, yes.
Imagine you add a SafeReadFile();
and whenever you tried reading a file and it was locked or you had no permissions it threw an exception instead of like returning null? I don't think that would be expected behaviour of something "safe"?
Anyway, yes, I don't expect that there will be many places to change? But again, I'm not very familiar yet about those internals. I'd expect to only have to change in one or two places? Anyway, I'll provide a POC as suggested.
from blazorise.
Related Issues (20)
- SelectList not executing the callback set for SelectedValueChanged HOT 2
- [Bug] DataGrid not works for large data first load HOT 1
- [2.0] Unify input component APIs HOT 3
- .srt subtitle files for video player HOT 2
- Docs : Blazorise Chart DataLabels Fix extension name
- ListView only Shows first 1.000 entries of a large list. HOT 1
- Add more Styling options for ListView Itemtemplates HOT 4
- [Docs] Automate API documentation HOT 5
- Add FilterTemplate examples to the DataGrid Docs HOT 1
- Getting 404 error playing clearkey hls with token in the Video player HOT 5
- [Bug]: headergroupcaption and displayable not working properly together
- Change type of ChartStreamingOptions.Delay from int? to long? HOT 3
- [Bug]: Grouping a Datagrid that uses Virtualize on an external source does not work HOT 3
- [2.0] DataGrid: Change Width from string to IFluentSizing
- Add MultiSelection to Datagrid SelectColumn HOT 11
- DataGrid.SelectedRow doesn't work - what am I doing wrong? HOT 3
- Expand Collapse Buttons for Data Grid HOT 7
- LicenseChecker is null problem HOT 2
- Transferlist captions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorise.