Repository navigation
Report failed extension discovery in the Packages tab and allow retry - #295
Open
SatyamKumarCS wants to merge 1 commit into
Open
SatyamKumarCS wants to merge 1 commit into
SatyamKumarCS wants to merge 1 commit into
Conversation
When the package.json of a federated extension could not be fetched, the Packages tab silently showed incomplete metadata and never retried until a full page reload. - Return the names of extensions whose metadata failed to load, and only mark discovery as complete when none failed; retry failed ones on the next discovery even without `force`. - Fetch extension metadata with bounded concurrency. - Add a Refresh button and a "could not be loaded" message to the Packages view. - Add an integration test for the failure and recovery flow. Fixes jupyterlab#294
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Fixes #294
Code changes
When the
package.jsonof a federated extension could not be fetched, the Packages tab silently showed that extension with almost no information, and it never retried until the whole page was reloaded. This PR makes the failure visible and recoverable.src/known-modules.tsdiscoverFederatedKnownModulesnow resolves with the names of the extensions whose metadata could not be loaded (an empty list when everything worked). Previously a failed fetch returnednulland nothing reported it.force;forcestill refreshes everything.package.jsonfiles are now fetched with bounded concurrency (6 at a time) instead of one after another.listFederatedDiscoveryFailures()which returns the names of the extensions that failed in the last run.src/token-sidebar.tsxforcepath ofdiscoverKnownModules, which no part of the UI called before.discoverKnownModulesinTokenSidebar.IOptionsnow returnsPromise<ReadonlyArray<string>>(the failed names). The only caller is insrc/index.ts, and its code did not need to change.style/base.css: small layout rules for the message and the button.ui-tests/tests/plugin-playground.spec.ts: new test, "packages view reports failed extension discovery and recovers on refresh". It blocks the extensionpackage.jsonrequests, checks that the message appears, unblocks, clicks Refresh, and checks that the extension recovers its real description.User-facing changes
Before this change, if the
package.jsonrequest failed (for example a flaky network), an entry likejupyterlab-tourwent from having Docs / GitHub /package.jsonlinks and its real description to showing only an npm link and "Discovered federated extension package". The packages it shares (ajv,react-joyride) disappeared from the list too. There was no message, and the entry stayed broken even after the network recovered, until a full reload.Before
The request for
package.jsonis blocked, then restored without reloading:After
The Refresh button shows as an icon in the narrow sidebar (the text label is hidden by existing styles at that width). It has the tooltip and aria-label "Refresh packages".
How I tested it
jupyterlab-tourandjupyterlab-js-logsinstalled, by blocking*extensions*package.jsonin the browser, then checked all three scenarios on the fixed build:jlpm playwright test tests/plugin-playground.spec.ts -g packagespasses locally on JupyterLab 4.6.4: the new test and the existing Packages-view test.tsc --noEmit, ESLint and Prettier pass on the changed files.AI usage
Backwards-incompatible changes
None for users.
discoverFederatedKnownModulesnow returns the failed extension names instead ofvoid, andTokenSidebar.IOptions.discoverKnownModuleshas the matching return type. Neither is part of the publicIPluginPlaygroundAPI, and no other code in the repo used the old return value.