stavroskasidis/BlazorWasmAntivirusProtection

Exceptions after upgrading to lastest version & NET 7.

Nickztar opened this issue · 3 comments

The issue is caused by changes in the startup script. Since the old one cannot handle the encryption etc.
As this image shows the startup script is read from the cache, causing it to handle it the old way.
image

The issue is following. Absolutely unreadable but i've been able to trace it to this.
image

As for my suggestion, for files that we don't want cached we usually add a query string to them to be able to make sure that the browser requests them again. Maybe it would be possible to add a property that you can change in the .csproj which is appended as a query string in the blazor.boot.json. That would make blazor load it with the query string and prevent it from reading it from the cache.

This should not be an issue, because the library module scripts are managed by blazor itself and are fetched using SHA (as seen in the boot.json file) for cache busting. If this is happening (and it shouldn't), it should be reported to the ASP.NET/Blazor team as a bug.

Not sure why you would think that is the case?
This should be the file that does that and it does not validate the integrity nor is it fetched using the SHA.
https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web.JS/src/JSInitializers/JSInitializers.ts#L24

I'll open a issue on their end but I still think that this is not something that it should be in charge of.

After some consideration you are probably correct in that this is not a issue specific to this library, but more so to do with Blazor itself. Will close my PR and have opened a issue for blazor:
dotnet/aspnetcore#46355

If anyone else runs into this issue my fix for it was to just create another build task to handle the invalidation of the module script. It super simple but it solves the issue. Might do more with it in the future. See my package here: https://github.com/nickztar/BlazorCacheBuster

Thanks for making this library and hope that my frustration did not shine through too much ;)