Live-proxy improvements: log UI polish, mixed default mode, proxy headers, and AppSync control-frame decoding#22
Merged
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)LIVE_CONNECT→ ok,LIVE_RECONNECT→ warn,DROP/ERROR→ err,DISPATCH_BURST→ accent;HEAD/OPTIONSagrupados conGET..methodcon fallback neutro para que ningún método quede sin pill (incluye el nuevoLIVE_DIAL).nowrappara nombres largos; pills TYPE/METHOD con padding ymin-widthunificados; rows con más aire.2. Modo
mixedpor defecto + headers de proxy al upstream liveDefaultChannelMode(mixed): los canales despachan local y reenvían al live target por defecto.X-Forwarded-For/-Host/-Proto,X-Real-IP); se deja de quitarOrigin.LIVE_DIALcon 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}.decodeAppSyncEnvelopeintentaba decodificarlos comodatay soltaba"appsync envelope not found"en cada uno, inundando los logs live de errores falsos — aunque los framesdatareales (p.ej.statsInfo) sí decodificaban.Ahora se reconocen los tipos distintos de
datay se devuelven como frames de control etiquetados por tipo, sin error. Verificado contra tráfico grabado: 673 framesdatasiguen decodificando, 148 frames de control quedan silenciosos, 0 errores (antes los 148 erraban).Verificación
npm run buildlimpio (tsc + vite).go build ./...ygo test ./...pasan.🤖 Generated with Claude Code