Kreya icon indicating copy to clipboard operation
Kreya copied to clipboard

"Run all importers" doesn't refresh responses when .proto file changes

Open ansjmoody opened this issue 1 year ago • 2 comments

Describe the bug If a response is changed in the proto file from a message to be stream after the example is modified in the Request tab, selecting "Run all importers" doesn't have any effect. When executing a request that returns multiple responses, only one response shows in the Responses tab.

To Reproduce Steps to reproduce the behavior:

  1. Create a proto file with a request that returns a message response.
  2. Load the file in Kreya.
  3. Click on the request in the navigation tree.
  4. Modify the request.
  5. Click Send. This shows a single response.
  6. Modify the proto file so the request returns a stream of messages.
  7. In Kreya, click the "Run all importers" button.
  8. Edit the Request so that it is expected to return multiple responses (if it isn't already set that way).
  9. Click the Send button.

Notice that only one response is shown in the Response tab.

Expected behavior Multiple responses are shown in the Response tab.

Environment (if possible, copy the information from the error dialog or the About menu):

  • OS: Windows 11
  • Kreya Version 1.15.0

Additional context To fix the issue, you can right click on the operation in the navigation tree and select "Reset operation". After doing this, clicking the Send button results in multiple responses shown. IMO, this step should not be necessary.

ansjmoody avatar Dec 18 '24 16:12 ansjmoody

Kreya currently does not modify existing requests when importing new information. It only adds the missing requests and shows if any requests were deleted.

Modifying existing operations comes with some questions. For example what if you change a gRPC method from streaming (multiple) requests to a single one. Should Kreya delete all but one request? Should this happen automatically (which the user then barely notices) or should it be a manual action? Should deleted fields be removed? And so on...

We do recognize that this should be improved, especially your case where it only affects the count of responses.

CommonGuy avatar Dec 19 '24 06:12 CommonGuy

In the example of modifying a request to return a single request instead of a stream, I think the behavior would be that after clicking the "Run all importers" button, nothing changes in the results for an already executed request. The next time that request is executed, there would just be one response shown. Basically- I don't think it is obvious that a user needs to select "Reset operation" to reload that request item and it would be nice if this happened when clicking "Run all importers" - except for modifying the example request text, which could be handled by manually selecting "Reset operation" or a new way, such as a button in the Request tab or a dialog that asks whether to replace the Request text if it isn't already what would be generated. When I see a button with a standard refresh icon AND the name of the button is "Run all importers" (as opposed to some indication that this button is to only import new requests), I expect that it really is re-importing and resetting everything from all .proto files in the project directory. If there's a need for the current functionality, then another way to provide this would be to add functionality to allow this - e.g. a new button or checkbox next to the button. In our development, it is common to change request message definitions while defining and testing the request. Sometimes the flow is to modify several messages and use Kreya for testing them. I assume this would be a common use case. Having a one click option to refresh all requests in all files is valuable.

ansjmoody avatar Dec 19 '24 16:12 ansjmoody