Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ansjmoody opened this issue Dec 18, 2024 · 2 comments
Open
Labels
enhancement New feature or request status:planned We plan to work on this

Comments

@ansjmoody
Copy link

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 ansjmoody added the bug Something isn't working label Dec 18, 2024
@CommonGuy
Copy link
Contributor

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 CommonGuy added enhancement New feature or request status:planned We plan to work on this and removed bug Something isn't working labels Dec 19, 2024
@ansjmoody
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:planned We plan to work on this
Projects
None yet
Development

No branches or pull requests

2 participants