fix(pingrip): forward data text frames in OPEN response#683
Conversation
Greptile SummaryThis PR fixes silent message drops in Pushpin's WebSocket-over-HTTP protocol by prepending the
Confidence Score: 5/5Safe to merge — the fix is narrow, well-tested, and the double-prefix regression flagged in a prior review has been correctly addressed. All three changed paths ( No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant App
participant OpenResponseBuilder
participant ResponseBuilder
participant Pushpin
participant WSClient as WebSocket Client
App->>OpenResponseBuilder: .text("hello")
OpenResponseBuilder->>ResponseBuilder: .text("m:hello")
Note over ResponseBuilder: stores TEXT frame with content "m:hello"
App->>OpenResponseBuilder: .binary(buf)
OpenResponseBuilder->>ResponseBuilder: .binary(concat("m:", buf))
Note over ResponseBuilder: stores BINARY frame with m: prefix
App->>OpenResponseBuilder: .subscribe(["chan"])
OpenResponseBuilder->>ResponseBuilder: .text('c:{"type":"subscribe","channel":"chan"}')
Note over ResponseBuilder: stores TEXT frame with c: prefix (no m: wrapping)
App->>OpenResponseBuilder: .toResponse()
OpenResponseBuilder->>ResponseBuilder: .toResponse()
ResponseBuilder-->>Pushpin: HTTP response body (serialized frames) + Grip headers
Pushpin->>Pushpin: strips "m:" prefix from data frames
Pushpin->>WSClient: forwards "hello" as text frame
Pushpin->>Pushpin: processes "c:" control frames internally (subscribe)
Reviews (2): Last reviewed commit: "fix tests name" | Re-trigger Greptile |
|
@greptile |
|
note: As discussed, we'll refactor the package to remove Grip headers if they turn out to be unnecessary and we'll correctly add the |
Pushpin's default
message-prefixis"m:", text/binary frames in the OPEN response not starting with that prefix are silently dropped.OpenResponseBuilder.text()and.binary()now prepend the prefix automatically so data frames are forwarded to the WebSocket client as intended. Pushpin strips the prefix before delivering to the browser.