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

"Try It" response preview caches previous response data #2514

Open
Lexy2 opened this issue Jan 30, 2024 · 3 comments
Open

"Try It" response preview caches previous response data #2514

Lexy2 opened this issue Jan 30, 2024 · 3 comments
Labels

Comments

@Lexy2
Copy link

Lexy2 commented Jan 30, 2024

When I click Send API Request the Response section appears and displays the response preview. You can search the page for a substring contained in the response data.
If the response size is large enough, the returned JSON in the preview window is not colorized.
If in this state you click Send API Request again, the non-colorized preview is not updated, even if the API request returned different data.
Search in page will not find the updated data in the Response section.

Context

Requires additional carefulness when checking the API responses and causes frustration.
The Copy button, however, copies the correct response data and if you paste it anywhere else, you will see the changes.
Web inspector shows the right API request and response from the server. It's just the uncolorized preview window that doesn't get updated.

Current Behavior

The Response preview contains the last long response result.

Expected Behavior

The Response preview updates the response window upon receiving the response data from the server.

Possible Workaround/Solution

Workaround: put the page in a state where there is no Response section.

  • Refresh the page and send the request again.
  • Click another endpoint and then click this endpoint to reload this section
  • Change the query parameters so that the response is small and colorized and then back

Steps to Reproduce

See general description.

  1. Send an API request that returns approximately >10000 lines of JSON so that it's not colorized in the preview.
  2. Copy the response somewhere.
  3. Modify the server data so that the same API request returns >10000 lines of JSON but different data.
  4. Click Send API request again
  5. Search the response window in the browser for the updated data.

Environment

  • Version used: @stoplight/elements 7.10.0 and the latest 8.0.2
  • Environment name and version: MS Edge/120.0.2210.144, Firefox 121.0.1, NodeJS v18.18.0
  • Operating System and version (desktop or mobile): Windows 10 22H2, desktop.
  • Link to your environment/workspace/project: private.
@chohmann chohmann added t/bug Something isn't working p/medium triaged jira labels Feb 2, 2024
Copy link

github-actions bot commented Feb 2, 2024

This ticket has been labeled jira. A tracking ticket in Stoplight's Jira (STOP-131) has been created.

@weyert
Copy link
Contributor

weyert commented Apr 24, 2024

@Lexy2 Any chance you can attach a problematic 10000 line JSON file?

@Lexy2
Copy link
Author

Lexy2 commented Apr 24, 2024

long.json

It's a bit more than 10k, but should work too :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants