dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.59k stars 10.06k forks source link

Service Worker is not updated on save or build #47388

Open tbasallo opened 1 year ago

tbasallo commented 1 year ago

Is there an existing issue for this?

Describe the bug

When updating the service worker, the built version in the bin folder is never updated. This is true whether you save or build. A Rebuild does replace the file in the bin folder.

*This is not an issue with the browser not picking up a new version of the service worker.

Expected Behavior

Changes to any files in the project should be reflected in the working directory

Steps To Reproduce

This bug exists in a brand-new project using VS 2022, latest and preview.

Exceptions (if any)

No response

.NET Version

7

Anything else?

No response

mkArtakMSFT commented 1 year ago

Thanks for contacting us. So is this a Blazor WebAssembly project then? In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem.

ghost commented 1 year ago

Hi @tbasallo. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

tbasallo commented 1 year ago

@mkArtakMSFT - here you go.

I didn't do it to begin with because it's literally a brand new project. Additionally, You can see that I update the SW and it never updates in the browser nor in the bin folder. If I rebuild it will rebuild. I didn't show that, but it does work.

https://github.com/tbasallo/wasm_no_sw_update_repro

I added a video clip of the steps as an example.

javiercn commented 1 year ago

@tbasallo does visiting with an incognito browser update it?

I don't remember the exact details, but we might have changed the SW to avoid copying it during build, as we can make an update to it during build and serve it without having to copy it to the output folder.

ghost commented 1 year ago

Hi @tbasallo. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

tbasallo commented 1 year ago

@javiercn no difference.

Even requesting it from something like postman or a different browser (that's not used) loads the same, old version

ghost commented 1 year ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

tbasallo commented 1 year ago

While this is unfortunate, it might be helpful to add a note that changes to service workers require a rebuild or they won't be seen. This is a time sucker if you're not aware of it,

ghost commented 11 months ago

To learn more about what this message means, what to expect next, and how this issue will be handled you can read our Triage Process document. We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. Because it's not immediately obvious what is causing this behavior, we would like to keep this around to collect more feedback, which can later help us determine how to handle this. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact work.