Altinn / app-lib-dotnet

Libraries used in Altinn Apps
BSD 3-Clause "New" or "Revised" License
8 stars 10 forks source link

Loading different versions of app-frontend-react in staging vs production #109

Open olemartinorg opened 1 year ago

olemartinorg commented 1 year ago

Background

I have a line of issues I've created to try to find solutions to the problem where new releases of app-frontend-react with subtle bugs in them can cause show-stopping problems in the production environment (see releated issues below). As discussed in the postmortem meeting today, the fundamental problem might be that app-frontend-react releases straight to the production environment (via the cdn), and apps on both the staging (tt02) and production environments load the latest release at the same time.

The frontend is loaded from the Index.cshtml file in each app. This defaults to load the latest major version, which all currently released apps are referencing.

Proposed solution

Instead of loading the frontend directly, we should automatically switch between different versions (i.e. staging and productions). Several ways to achieve this has been proposed:

Related issues

ivarne commented 1 year ago

We kind of need Index.cshtml to reference a specific frontend version anyway (with some way of automatic updating). The current "silent" updates has caching issues where css and js might come out of sync. When we implement code splitting or add more assets, it will become even more problematic when the main js file gets downloaded and all the referenced assets are gone. A bad release (as we have had, and will have again), currently persists in chrome for a long time (unless the user push ctrl-shift-r), and support will get confused because they have not gotten the bad release yet.