lukehaas/RunJS

Output not repeated when calling the same API, even if one should be partial data.

Opened this issue · 4 comments

I was testing out an API I am self hosting and was testing out your SW (saw it used in a video and was considering buying it as it looks useful).

I noticed that if I made two requests to the same specific API, the right side showed the output only once, even though the first time I printed just one element, and the next time I was a logging everything returned.

Note right side only lists iPhone 9, which is the partial output from the returned JSON (listed fully below)

Screenshot 2024-02-25 at 23 40 32

If I make the old school fetch usage get the second product I get the name from product 1, and the full details of product two.

Screenshot 2024-02-25 at 23 40 13

Adding a second instance of test() doesn't cause a second "iPhone 9" to appear in the output.

This happened on 2.10.1 which I had downloaded yesterday or friday, and 2.11 which I downloaded today.


Json output for product 1

{
  id: 1,
  title: 'iPhone 9',
  description: 'An apple mobile which is nothing like apple',
  price: 549,
  discountPercentage: 12.96,
  rating: 4.69,
  stock: 94,
  brand: 'Apple',
  category: 'smartphones',
  thumbnail: 'https://cdn.dummyjson.com/product-images/1/thumbnail.jpg',
  images: [
    'https://cdn.dummyjson.com/product-images/1/1.jpg',
    'https://cdn.dummyjson.com/product-images/1/2.jpg',
    'https://cdn.dummyjson.com/product-images/1/3.jpg',
    'https://cdn.dummyjson.com/product-images/1/4.jpg',
    'https://cdn.dummyjson.com/product-images/1/thumbnail.jpg'
  ]
}

Trying to get it to print out two different fields via two different methods also doesn't work

Screenshot 2024-02-25 at 23 55 00

Hey @tarasis
I encountered a peculiar behavior in versions 2.10.1 and 2.11 where making two consecutive requests to the same API endpoint results in the UI only displaying the output of the first request. The first request's output was partial (just one element, "iPhone 9"), and the second request was supposed to log everything returned, but the UI failed to update to show the full details.

Recommendation:
For those experiencing similar issues or seeking a comprehensive tool for API testing and monitoring, consider using Apidog. It offers robust features for simulating, testing, and documenting API behaviors, which could be invaluable in troubleshooting and ensuring API reliability.

@tarasis, thanks for raising this. I will look into it 👍

Hey @habibur4340, you obvioius AI rewriter and advertiser

Screenshot 2024-02-26 at 09 35 04

@lukehaas wonderful, thank you!