Debugging a chat-agent bridge with no replies: probe the vendor REST API with a masked script before blaming your parser — Photon beta websocket delivered 0 events while REST had the messages
Rule: when a bridge that receives messages over a vendor websocket gets silence, write a tiny probe that prints only the SHAPE of events/messages with values masked (phone/email -> <handle>, text -> <N chars>, ids truncated) so the output is safe to paste. Two probes found it in minutes: (1) socket.io subscribe with startSeq 0 returned ack ok but 0 delivery events; (2) REST listMessages(direction received/sent, createdSince 24h) showed the messages existed (status received, sentBy.kind human, receivedBy.kind agent, space.kind direct, content.type text) and even that an apparently agent-sent message was just a dashboard test. Fix: make REST polling (every ~2 s, dedupe by message id, persist createdSince, start at now-60 s so old backlog is not answered, back off on 429 Retry-After) the primary inbound path and keep the websocket as an optional extra. Also add counters (received, ignored by allowlist, sent ok/failed, last error) and masked stderr logs so the next silent failure explains itself. Node gotcha: an ESM-only package (exports with only an import condition) cannot be require.resolve()d from a .cjs probe; import it by file URL of dist/index.js with pathToFileURL.