Compare commits

...

3 Commits

Author SHA1 Message Date
lebaudantoine bd51c142f6 🐛(frontend) return real 404s for missing hashed assets
Nginx was rewriting missing `/assets/*` files to `index.html`, so
requests for stale chunks got a 200 with the SPA shell served as a
JS module. That is what turned a plain 404 into the confusing:

  "TypeError: error loading dynamically imported module"

whenever a client loaded before a deployment requested an old chunk.

Stop rewriting missing `/assets/*` to `index.html`: those requests
now return a real 404 with `Cache-Control: no-store`. SPA route
fallback for non-asset paths is unchanged.
2026-08-12 19:40:47 +02:00
lebaudantoine 2af6157265 (frontend) recover from stale lazy-loaded chunks after a deploy
Route components are code-split with content-hashed filenames. A
user who loaded the app before a deployment (typically someone
sitting in a call) still holds an `index.html` referencing old chunk
names. When they navigate after the deploy — e.g. to `/feedback` on
leaving a room — the old chunk is gone and the dynamic import fails
with "TypeError: error loading dynamically imported module".

Reload the page on that failure to fetch a fresh `index.html` with
the current hashes, which transparently fixes the stale-deploy case.

Guard against infinite reload loops with a `RELOAD_COOLDOWN_MS`: if
the import fails again right after a reload, the cause is not a
stale deploy (ad blocker, proxy, outage) and reloading further would
loop forever. In that case, let the error propagate so it reaches
monitoring.

Inspired by https://vite.dev/guide/build#load-error-handling
2026-08-12 19:37:24 +02:00
lebaudantoine 047a4c9f3f 🔖(minor) bump release to 1.26.0 2026-08-12 14:56:03 +02:00
15 changed files with 54 additions and 14 deletions
+6
View File
@@ -8,6 +8,12 @@ and this project adheres to
## [Unreleased]
### Fixed
- ✨(frontend) recover from stale lazy-loaded chunks after a deploy
## [1.26.0] - 2026-08-12
### Added
- 📈(frontend) capture media diagnostics on media errors
+7
View File
@@ -74,6 +74,13 @@ server {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
try_files $uri =404;
error_page 404 = @asset_missing;
}
location @asset_missing {
add_header Cache-Control "no-store" always;
return 404;
}
# Serve static files
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "agents"
version = "1.25.2"
version = "1.26.0"
requires-python = ">=3.12"
dependencies = [
"livekit-agents==1.6.7",
+1 -1
View File
@@ -9,7 +9,7 @@ resolution-markers = [
[[package]]
name = "agents"
version = "1.25.2"
version = "1.26.0"
source = { virtual = "." }
dependencies = [
{ name = "livekit-agents" },
+1 -1
View File
@@ -7,7 +7,7 @@ build-backend = "uv_build"
[project]
name = "meet"
version = "1.25.2"
version = "1.26.0"
authors = [{ "name" = "DINUM", "email" = "dev@mail.numerique.gouv.fr" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
+1 -1
View File
@@ -1187,7 +1187,7 @@ wheels = [
[[package]]
name = "meet"
version = "1.25.2"
version = "1.26.0"
source = { editable = "." }
dependencies = [
{ name = "aiohttp" },
+7
View File
@@ -14,6 +14,13 @@ server {
location ~* ^/assets/.*\.(css|js|json|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000";
try_files $uri =404;
error_page 404 = @asset_missing;
}
location @asset_missing {
add_header Cache-Control "no-store" always;
return 404;
}
# Serve static files
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "meet",
"version": "1.25.2",
"version": "1.26.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "meet",
"version": "1.25.2",
"version": "1.26.0",
"dependencies": {
"@fontsource-variable/atkinson-hyperlegible-next": "5.2.6",
"@fontsource-variable/lexend": "5.2.11",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "meet",
"private": true,
"version": "1.25.2",
"version": "1.26.0",
"type": "module",
"scripts": {
"dev": "panda codegen && vite",
+20
View File
@@ -2,6 +2,26 @@ import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
const CHUNK_RELOAD_KEY = 'vite-preload-error-reload-at'
const RELOAD_COOLDOWN_MS = 30_000
window.addEventListener('vite:preloadError', (event) => {
try {
const lastReloadAt = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0
if (Date.now() - lastReloadAt <= RELOAD_COOLDOWN_MS) {
// Recent reload didn't help: not a stale deploy, surface the error.
return
}
sessionStorage.setItem(CHUNK_RELOAD_KEY, String(Date.now()))
} catch {
// Without sessionStorage we cannot guard against a reload loop:
// don't auto-reload, let the error propagate.
return
}
event.preventDefault()
window.location.reload()
})
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "mail_mjml",
"version": "1.25.2",
"version": "1.26.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "mail_mjml",
"version": "1.25.2",
"version": "1.26.0",
"license": "MIT",
"dependencies": {
"@html-to/text-cli": "0.6.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mail_mjml",
"version": "1.25.2",
"version": "1.26.0",
"description": "An util to generate html and text django's templates from mjml templates",
"type": "module",
"dependencies": {
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "sdk",
"version": "1.25.2",
"version": "1.26.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sdk",
"version": "1.25.2",
"version": "1.26.0",
"license": "ISC",
"workspaces": [
"./library",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "sdk",
"version": "1.25.2",
"version": "1.26.0",
"author": "",
"license": "ISC",
"description": "",
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "summary"
version = "1.25.2"
version = "1.26.0"
dependencies = [
"fastapi[standard]>=0.105.0",
"uvicorn>=0.24.0",