Closed Aivean closed 1 year ago
@Lexy2 has a good point, it makes sense to reload the page transparently to the user (e.g. on certain navigation events). Marking as draft for now.
Testing changed fingerprint:
FINGERPRINT=xxx
to your .env
fileX-Fingerprint: xxx
.env
file to FINGERPRINT=yyy
docker stop orbitar-caddy-1
docker rm orbitar-caddy-1
docker-compose -f docker-compose.dev.yml up caddy
to reloadOtherwise looks good, I like the new update mechanism way more than an explicit Reload button.
Otherwise looks good, I like the new update mechanism way more than an explicit Reload button.
I thought more about it, there is a chance to simplify its implementation. Will try today.
@Lexy2 , I simplified the reloading logic (and addressed your comment), please check.
If someone has a page open and a server update is deployed, then when this person clicks a link to open a post, for example, the link will open and then the page will reload. Which is not nice, but much better than attaching an observable to each link tag.
Problem statement
Since we're using react router, when we navigate to any page, the html and js is not reloaded. Until user force-refreshes the page, the app and the backend versions will be divergent.
Solution
Testing
Tested on staging
Deploy action1: https://github.com/spaceshelter/orbitar/actions/runs/5096833950/jobs/9162954788
Deploy action2: https://github.com/spaceshelter/orbitar/actions/runs/5096844123
Added headers:
Checked that page is refreshed on link click after the deployment.