Skip to content

Live-proxy improvements: log UI polish, mixed default mode, proxy headers, and AppSync control-frame decoding#22

Merged
Dustec merged 3 commits into
mainfrom
fix/log-ui-polish
May 27, 2026
Merged

Live-proxy improvements: log UI polish, mixed default mode, proxy headers, and AppSync control-frame decoding#22
Dustec merged 3 commits into
mainfrom
fix/log-ui-polish

Conversation

@Dustec

@Dustec Dustec commented May 27, 2026

Copy link
Copy Markdown

Mejoras alrededor del proxy live de Ditto y la observabilidad de los logs.

1. Pulido del log de requests + métodos sin color (frontend/src/index.css)

  • Cobertura de color para tipos que salían sin pill: LIVE_CONNECT → ok, LIVE_RECONNECT → warn, DROP/ERROR → err, DISPATCH_BURST → accent; HEAD/OPTIONS agrupados con GET.
  • .method con fallback neutro para que ningún método quede sin pill (incluye el nuevo LIVE_DIAL).
  • Columna METHOD ensanchada (62px → 104px) + nowrap para nombres largos; pills TYPE/METHOD con padding y min-width unificados; rows con más aire.

2. Modo mixed por defecto + headers de proxy al upstream live

  • DefaultChannelMode (mixed): los canales despachan local y reenvían al live target por defecto.
  • Headers estándar de reverse-proxy al live target (X-Forwarded-For/-Host/-Proto, X-Real-IP); se deja de quitar Origin.
  • Nuevo evento LIVE_DIAL con resumen redactado del dial para depurar conexiones al upstream.

3. Frames de control de AppSync ya no se reportan como error de decode

AppSync manda keep-alives ({"type":"ka"}) y frames de ciclo de vida (subscribe, subscribe_success, complete, …) sin payload {t,e}. decodeAppSyncEnvelope intentaba decodificarlos como data y soltaba "appsync envelope not found" en cada uno, inundando los logs live de errores falsos — aunque los frames data reales (p.ej. statsInfo) sí decodificaban.

Ahora se reconocen los tipos distintos de data y se devuelven como frames de control etiquetados por tipo, sin error. Verificado contra tráfico grabado: 673 frames data siguen decodificando, 148 frames de control quedan silenciosos, 0 errores (antes los 148 erraban).

Verificación

  • npm run build limpio (tsc + vite).
  • go build ./... y go test ./... pasan.

🤖 Generated with Claude Code

Dustec and others added 2 commits May 26, 2026 20:46
The METHOD column rendered several event types as bare, uncolored text
because only HTTP verbs and a subset of socket events had color variants.
Add color coverage for the socket lifecycle events that were missing
(DROP, LIVE_CONNECT, LIVE_RECONNECT, DISPATCH_BURST) plus HTTP HEAD/OPTIONS,
and give .method a neutral tinted fallback so no method can ever render
without a pill background.

Also fix layout inconsistencies in the log table:
- Widen the METHOD column (62px → 104px) and add white-space: nowrap so
  long socket event names (LIVE_RECONNECT, DISPATCH_BURST) no longer wrap
  or overflow their cell.
- Unify pill sizing: matching padding and a min-width on .tag-type so the
  TYPE and METHOD pills align.
- Give rows breathing room (height 32px → min-height 36px, padding and gap
  bumped) for a more consistent vertical rhythm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ream

- Introduce DefaultChannelMode (mixed) and use it everywhere a channel
  lacks an explicit config, so channels both dispatch locally and forward
  to the live target by default instead of defaulting to mock-only.
- Forward standard reverse-proxy headers (X-Forwarded-For/-Host/-Proto,
  X-Real-IP) when dialing the live target, and stop stripping Origin so the
  upstream sees the same request the client would send directly.
- Add a LIVE_DIAL log event summarizing the dial (target, client host/addr,
  subprotocols, redacted headers) to make upstream connection issues
  debuggable without leaking credentials.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Dustec Dustec changed the title Polish request-log rows and fix uncolored method pills Log UI polish + default mixed channel mode and live-upstream proxy headers May 27, 2026
AppSync emits periodic keep-alives ({"type":"ka"}) and subscription
lifecycle frames (subscribe, subscribe_success, complete, error, …) that
carry no {t, e} payload. decodeAppSyncEnvelope tried to decode them like
data frames and surfaced "appsync envelope not found" on every one,
flooding the live logs with spurious decode errors — even though actual
data frames (e.g. statsInfo) were decoding fine.

Recognize non-"data" frame types up front and return them as control
frames labelled by type with no decode error. Verified against recorded
traffic: 673 data frames still decode, 148 control frames now go quiet,
zero errors (previously all 148 errored).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Dustec Dustec changed the title Log UI polish + default mixed channel mode and live-upstream proxy headers Live-proxy improvements: log UI polish, mixed default mode, proxy headers, and AppSync control-frame decoding May 27, 2026
@Dustec Dustec merged commit 7bbf35a into main May 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant