Skip to content

[Bug] Plugin doesn't work for big responses #116

@borissmidt

Description

I'm trying to get the grpc-web-devtools to work but it seems that for large responses the plugin doens't work. unless i make it explicitly a string.

//this doesn't work because the response is too big:
window.postMessage({type: "__GRPCWEB_DEVTOOLS__",method: methodDesc.methodName, methodType: "unary", requestId: requestId, request:_request, response: response})

//works fine
window.postMessage({type: "__GRPCWEB_DEVTOOLS__",method: methodDesc.methodName, methodType: "unary", requestId: requestId, request:_request, response: {test : [{object: "test"}]}})

//this works totally fine.
window.postMessage({type: "__GRPCWEB_DEVTOOLS__",method: methodDesc.methodName, methodType: "unary", requestId: requestId, request: JSON.stringify(_request, null, 2), response: JSON.stringify(response, null, 2)})

i supspect it has something to do with in NetworkDetails.js.

maybe the plugin should by default collaps the src from level 1?

          <ReactJson
            name="grpc"
            theme={theme}
            style={{backgroundColor:'transparent'}}
            enableClipboard={clipboardIsEnabled}
            src={src}
          />

Note if i make my own events i can support it with the improbable Eng lib. And even when using interceptors with the mainstream grpc/grpc-web.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions