ArchGPT / insomnium

Insomnium is a fast local API testing tool that is privacy-focused and 100% local. For testing GraphQL, REST, WebSockets and gRPC. This is a fork of Kong/insomnia
MIT License
3.33k stars 125 forks source link

Load gRPC methods whenever selecting a new request #57

Closed Perryvw closed 9 months ago

Perryvw commented 9 months ago

Fixes #52

After debugging this, it seems to me the issue was that the methods were only loaded for the request that happened to be selected at startup. This caused the method selection and request body to be broken for all other requests.

This PR changes request loading so that gRPC methods are loaded whenever the GrpcRequestPane is opened for a new gRPC request.

This whole loading of proto methods is pretty inefficient, it writes the proto file to temporary storage and re-parses it every time a request is selected. This could be improved by trivially adding a little cache in ipc/grpc that memoizes these results, but the downside is that users would then have to explicitly reload the protos every time they change.

archywillhe commented 9 months ago

👍👍