fix(ssr): resolve EventSource SSR violations and implement best practices

- Fix EventSource is not defined error in queue dashboard
- Add browser guards for all EventSource usage
- Replace static constants (EventSource.OPEN/CLOSED) with numeric values
- Fix setInterval SSR violation in LLM health indicator
- Replace $effect anti-pattern with onMount in share page
- Add comprehensive SvelteKit SSR best practices documentation
- Add SSR audit and testing verification

All changes follow SvelteKit best practices and are verified against
official documentation. Production build succeeds with no SSR errors.

Closes: FixEventSourceSSR
See: docs/outcomes/FixEventSourceSSR.md
This commit is contained in:
Giancarmine Salucci
2025-12-22 03:00:29 +01:00
parent 35d6f6e40a
commit 8545744bb1
47 changed files with 12827 additions and 363 deletions

View File

@@ -5,7 +5,7 @@
"value": "SDRORLyWEsWWty2ZoVGdER",
"domain": ".instagram.com",
"path": "/",
"expires": 1800851069.9794,
"expires": 1800928744.690244,
"httpOnly": false,
"secure": true,
"sameSite": "Lax"
@@ -45,7 +45,7 @@
"value": "59661903731",
"domain": ".instagram.com",
"path": "/",
"expires": 1774067069.979487,
"expires": 1774144744.690335,
"httpOnly": false,
"secure": true,
"sameSite": "None"
@@ -55,24 +55,24 @@
"value": "1280x720",
"domain": ".instagram.com",
"path": "/",
"expires": 1766895870,
"expires": 1766973545,
"httpOnly": false,
"secure": true,
"sameSite": "Lax"
},
{
"name": "sessionid",
"value": "59661903731%3AbekaIlo4nn7x2n%3A29%3AAYig82sWcnm2bGaQlry72PN7OrhFZ4YYZt4_qM78dA",
"value": "59661903731%3AbekaIlo4nn7x2n%3A29%3AAYiOptViRm0BBaSr0oiyyATkN-P9J5lXEAaMjb44dg",
"domain": ".instagram.com",
"path": "/",
"expires": 1797822591.250111,
"expires": 1797862875.361196,
"httpOnly": true,
"secure": true,
"sameSite": "Lax"
},
{
"name": "rur",
"value": "\"CLN\\05459661903731\\0541797827069:01fe263659ed914f1ffebb931cb01384ada1b8d59314115427d88c227c8b8dd50b867ce3\"",
"value": "\"CLN\\05459661903731\\0541797904744:01fe5d62d8260e30673f33a5eea274e139f33ff8cabf7bdace78ebe98861a8c688ac4b3e\"",
"domain": ".instagram.com",
"path": "/",
"expires": -1,
@@ -87,15 +87,19 @@
"localStorage": [
{
"name": "chatd-deviceid",
"value": "77312b9f-46de-4a13-bc4c-c0b033527fed"
"value": "c5497e54-6b46-47bb-a7bb-b9934cf13895"
},
{
"name": "hb_timestamp",
"value": "1766290825220"
"value": "1766366946059"
},
{
"name": "IGSession",
"value": "6m2tlb:1766292870184"
"value": "kc8y0b:1766370543710"
},
{
"name": "mutex_polaris_banzai",
"value": "qkje7m:1766366947092"
},
{
"name": "pixel_fire_ts",
@@ -103,19 +107,23 @@
},
{
"name": "signal_flush_timestamp",
"value": "1766290825236"
"value": "1766366946077"
},
{
"name": "Session",
"value": "jkk7vp:1766291105184"
"value": "ubnyuz:1766368778710"
},
{
"name": "has_interop_upgraded",
"value": "{\"lastCheckedAt\":1766279008975,\"status\":false}"
"value": "{\"lastCheckedAt\":1766366944051,\"status\":false}"
},
{
"name": "mutex_banzai",
"value": "qkje7m:1766366947092"
},
{
"name": "banzai:last_storage_flush",
"value": "1766279009540.7998"
"value": "1766366944520.7"
}
]
}