[RESOLVED] Notification when a container is being replaced?

Hey all,

Looking for a way to tell on the client when a container is about to be replaced. In our admin application it’d be nice to alert users to save their work before the container gets swapped over.

Thanks!

How are you losing your work? Due to the browser refresh? This can be handled by catching the browser refresh

With the actual deployment, our deployment automatically updates a setting in our app through a webhook. Our app settings have a hash value in DB which is being updated whenever a setting is changed. All client apps are subscribed to that value which means that all apps are informed whenever a deployment is about to happen i.e. changing old containers with new containers.

1 Like

Hey David,

Thanks for the response.

It is due to the browser refresh. What do you mean by “catching” it?

Our app settings have a hash value in DB which is being updated whenever a setting is changed.

Ah I like this idea.

You can also control app full refresh using AUTOUPDATE_VERSION env var.

If you don’t update this env var the full refresh is not going to happen, of course, your app will continue using the previous js/css bundles until the user refreshes the page.

Here is an implementation in react when using react-router-dom
https://reactrouter.com/core/api/Prompt

Appreciate the help @rjdavid and @filipenevola!

I went with the AUTOUPDATE_VERSION env var on our admin instance. Works like a charm. App doesn’t auto refresh with the new bundles until a manual refresh.