Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unnecessary fetches when getting the sketches via the Create API #1849

Copy link
Copy link
Open
@kittaakos

Description

@kittaakos
Issue body actions

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:

HTTP GET: https://api-dev.arduino.cc/create/v2/sketches?user_id=me&limit=50&offset=0
HTTP GET: https://api-dev.arduino.cc/create/v2/sketches?user_id=me&limit=50&offset=50

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.

Screen Shot 2023-02-01 at 10 32 05

The second fetch response body is empty.

Screen Shot 2023-02-01 at 10 33 58

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

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: cloudRelated to Arduino Cloud and cloud sketchesRelated to Arduino Cloud and cloud sketchestopic: codeRelated to content of the project itselfRelated to content of the project itselftype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.