In my app, when I add a Complete event handler to my RadzenUpload, the upload functionality becomes unresponsive. There's no error and my upload endpoint is not called. This is when uploading very small files (or anything, but I'm testing with small files). If I remove the Complete event handler, it starts working. (But this defeats the purpose -- I need to know when uploads are done.)
My endpoint requires authorization, and I'm using a .NET8 minimal API approach. I don't see why that would matter, and like I say it works fine without the Complete event handler. Any idea what I'm missing?
My upload endpoint returns simply Results.Ok(), so I don't think this has to do with the size of the return value hitting a SignalR limit. (This is Blazor Server btw.) I've looked in the console and Network activity to see if I can tell what's happening, but there seems to be no activity at all when the Complete event is added.
I tried setting breakpoints in the JavaScript, and I see that a var uploadComponent is appearing as undefined when the Complete handler is added. I found the same symptom when adding a RadzenUploadHeader. (I went down a long rabbit hole about antiforgery tokens, but got nowhere.) You see the next line is if (!uploadComponent) { return; } -- this explains why the upload is becoming unresponsive.
But I cannot fathom why adding a Completed event handler is causing this.
I'm using 4.23.9 -- and I cloned the Radzen repo and ran it myself locally -- and it works for sure. I figured it had to be working, and that I have run into an edge case of some kind. I'm thinking how I can make a public repro, because I know edge cases like this are all but impossible to debug without a valid example. Unfortunately, this is not an app I can easily share due to some external dependencies and API keys present, so I have to think about that.
I figured out this has to do with the Visible property of the Upload component. I was hiding and showing the Upload component based on a condition. When dynamically setting Visible = true, the corresponding JavaScript is not rendered. I suggest adding some guidance on use of the Visible property (i.e. avoid it) or perhaps there's a bug worth fixing.