Unnecessary fetches when getting the sketches via the Create API #1849
Labels
topic: cloud
Related to Arduino Cloud and cloud sketches
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
Pagination must be used when retrieving the sketches. This has been added in #875, but the proposed code does one extra fetch when all sketches have been loaded.
For example, when I have one single sketch, I will see two HTTP GETs:
To reproduce
Start IDE 2.0.3, log into the cloud, open dev tools, switch to the network tab, enable XHR/Fetch, reload the browser window, and see the unnecessary fetch with 50 offsets. I have one single sketch.
The second fetch response body is empty.
The other problem is that IDE2 runs the sketches fetch twice, and IDE2 runs the same fetches in every opened browser window.
Expected behavior
There are fewer number of remote fetches to the server.
Arduino IDE version
2.0.3
Operating system
macOS
Operating system version
12.5.1
Additional context
No response
Issue checklist
The text was updated successfully, but these errors were encountered: