You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/internal/2026-06-26-sync-status-report.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,16 @@ Tutte e 7 le tappe sono implementate su `dev3`, dietro il flag
34
34
| 4 | desired-state → poll ~5min | ✅ |`JHT_DESIRED_STATE_SEC` (default 300) nel loop lento |
35
35
| 5 | heartbeat → poll ~3min | ✅ |`JHT_HEARTBEAT_SEC` (default 180) — **sotto la soglia stale 5min** della dashboard (`team-state/claim/route.ts``HEARTBEAT_STALE_MS`). Presence vera **DEFERRED** (richiede di cambiare come il web legge l'online) |
36
36
| 6 | paracadute poll-lento | ✅ | ogni ~5min (`JHT_PARACHUTE_SEC`) ri-legge sync + ticket → recupero se il socket muore. Gira anche se il setup Realtime fallisce (degrada a poll puro) |
37
-
| 7 | test su andris dietro flag | ⏳ |**da fare da Leone**: accendere `JHT_REALTIME_SYNC=1` su andris, validare reattività + recupero a socket caduto |
37
+
| 7 | test su andris dietro flag | ✅ |**VALIDATO 2026-06-26**: `JHT_REALTIME_SYNC=1` su andris, canali `team_state`+`position_tickets` SUBSCRIBED, heartbeat 70s (online), "Sync now" end-to-end via websocket in **1,6s** (`sync_ok=true`). Vedi sotto |
38
+
39
+
### 🧪 Esito test live su andris (2026-06-26)
40
+
- Immagine `:latest` (build 26/06 14:34) verificata contenere il codice; **mig 048 applicata a prod** (`position_tickets` in publication + replica full).
41
+
-`JHT_REALTIME_SYNC=1` aggiunto al compose andris (oltre a `JHT_SUPABASE_DIRECT=1` già presente).
- 🐛 **BUG TROVATO E FIXATO live** (`90447acf4`): postgres_changes con RLS non consegnava nulla (canale SUBSCRIBED ma 0 eventi) perché il socket Realtime usava l'**anon key** invece dello **user-JWT** (l'auto-wiring del token in supabase-js è async e arrivava DOPO la subscribe). Fix: `client.realtime.setAuth(access_token)` forzato PRIMA delle subscribe.
45
+
- ⚠️ **L'immagine NON ha ancora il fix setAuth** (committato dopo la build): andris gira col file **patchato a mano** (`docker cp`). Per renderlo permanente serve **merge dev3→master + rebuild :latest + redeploy**. Finché non si rifà l'immagine, NON fare `docker compose up -d` su andris (perderebbe la patch).
46
+
- ⏳ Non ancora stress-testato: recupero a socket caduto (paracadute, validato per design) e dual-auth supabase-direct+realtime nel tempo (nessun errore finora).
38
47
39
48
**Nota sul lavoro parallelo:** la divisione in 3 (Part A/B/C) ha dato in pratica solo la
40
49
**mig 048** (consegnata duplicata da due branch, non costruita sulla fondazione). Il
0 commit comments