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

fix: reduced unnecessary GET /sketches request #2014

Merged
merged 1 commit into from
Apr 24, 2023
Merged

fix: reduced unnecessary GET /sketches request #2014

merged 1 commit into from
Apr 24, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Apr 12, 2023

Motivation

This PR slightly modifies the implementation of arduino/arduino-ide#875 to reduce the unnecessary GET /sketches. The endpoint claims to support pagination, but it does not. So if the number of sketches can be divided by the limit without a remainder, another fetch is required.

This PR does not change the limit but leaves it at 50. This PR adds tests to verify the new behavior. Note that those tests do not run on the CI, only locally when secrets are set in the environment.

To verify:

  • you have more than 50 sketches on https://create.arduino.cc/editor,
  • open IDE2 and log in to the cloud, and
  • verify that you see all you sketches in the cloud sketchbook tree.

Change description

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Apr 12, 2023
@kittaakos kittaakos self-assigned this Apr 12, 2023
@kittaakos kittaakos added the topic: cloud Related to Arduino Cloud and cloud sketches label Apr 12, 2023
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactoring Akos!

@kittaakos kittaakos merged commit 097c92d into main Apr 24, 2023
@kittaakos kittaakos deleted the #1849 branch April 24, 2023 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants