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: app store ui not updating to show installing plugins; cache npm response for one minute #1871

Merged
merged 2 commits into from
Feb 2, 2025

Conversation

sbender9
Copy link
Member

@sbender9 sbender9 commented Jan 29, 2025

When the user clicks the Update button the App store UI is not showing that the server is doing the update IF there is an error response from the npm registry when fetching the list of plugins & webapps.

Npm registry has rate limits and apparently some people have hit those: in the course of using the App store ui the server fetches the lists of modules and webapps several times, that can cause npm registry to return an error message instead of the listing.

This PR fixes the UI not updating with two separate methods:

  • if npm registry returns an error the error is not simply ignored, but handled like the App store would not be available
  • by adding a 1 minute cache for the npm registry modules listing

The cache should keep the rate limit not intervening and the App store working properly.

@sbender9 sbender9 added the fix label Jan 29, 2025
@sbender9 sbender9 requested a review from tkurki January 29, 2025 20:21
@tkurki tkurki changed the title fix: app store ui not updating to show installing plugins fix: app store ui not updating to show installing plugins; cache npm response for one minute Feb 1, 2025
sbender9 and others added 2 commits February 1, 2025 20:44
The timeout mechanim was removed already earlier, but
we had left the function call to obfuscate the logic.

Remove the unnecessary construct and use a simple
promise chain to handle fetch result.
@tkurki tkurki force-pushed the plugin-install-fix branch from cbfa231 to 16ea7a0 Compare February 1, 2025 18:45
Copy link
Member

@tkurki tkurki left a comment

Choose a reason for hiding this comment

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

Simplified the code as i noticed there is not "timeout" apart from the http request timeouts.

Rewrote the PR title and description to describe the failure mechanism and how this PR attempts to improve things.

@tkurki tkurki merged commit 4cd7775 into master Feb 2, 2025
3 checks passed
@tkurki tkurki deleted the plugin-install-fix branch February 2, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants