jsakamoto / Toolbelt.Blazor.PWA.Updater

Provide "Update Now" UI and feature to your Blazor PWA that appears when the next version of one is available.
Mozilla Public License 2.0
136 stars 7 forks source link

Displays update available, but does nothing on click after upgrading to DotNet8 Webassembly from DotNet7 #16

Open HershelJPatt opened 1 year ago

HershelJPatt commented 1 year ago

Appreciate you sharing this amazing project as it has helped us deploy with more confidence as the users gets our updates immediately versus the typically struggles with service workers!

Any insight would be appreciated, the banner does display, but nothing occurs.

Expected behavior: Refresh the application page.

hershelJ commented 1 year ago

I realize the updater is working, but it was being blocked due to pending http requests. Recently I changed my SignalR Client hubs to utilize HTTP long Polling transport method which keeps my hub connections in these "continuous" pending state.

I realize if I left the app open long enough after I hit "Update Now" it would eventually update, but I couldn't connect the reasoning, but it was because my auth token would eventually expire & all connections would finally lapse prior to their renewals.

I will make some adjustments & verify, but I am fairly certain this is what is occurring.

jsakamoto commented 10 months ago

@HershelJPatt

Any insight would be appreciated, the banner does display, but nothing occurs.

Do you mean that there is nothing to happen even though a user clicks the "UPDATE NOW" button?

image

Only appearing the banner doesn't refresh the page. The "UPDATE NOW" button must be clicked to refresh the page.

And if the page never refresh even when a user clicks the "UPDATE NOW" button, then could you recheck your code so that step 4, "Modify the 'service-worker.published.js' file", was implemented correctly by yourself?

https://github.com/jsakamoto/Toolbelt.Blazor.PWA.Updater?tab=readme-ov-file#4-modify-the-service-workerpublishedjs-file

HershelJPatt commented 10 months ago

Hi @jsakamoto,

I've found the root cause being SignalR connections utilized within my APP that is using the transport protocol HTTP long polling & if any pending https requests are still in the "pending" status it will not trigger the reload/update which I assume is by design for service workers. Once the SignalR connection closes down for to refresh the authentication token, the app then triggers the reload. I've yet to find a work around while using your package, but if you have any suggestions, it would be greatly appreciated!