Repository navigation
(fix) O3-4646: Register optional dependency feature flags for backend modules on every page - #2038
Open
gargnaitik wants to merge 1 commit into
Open
gargnaitik wants to merge 1 commit into
gargnaitik wants to merge 1 commit into
Conversation
… modules on every page The app shell read only the first page of the backend module list, so an optional dependency on a module listed on a later page never turned on its feature flag. Load every page with openmrsFetchAll and add tests.
🦋 Changeset detectedLatest commit: 32713bc The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
[Medium impact] This PR appears safe to merge.
|
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.



Requirements
Summary
At startup the app shell fetches the installed backend modules to turn on the feature flags that frontend modules declare for their optional backend dependencies.
setupOptionalDependenciesread only the first page of/module, which the REST module pages atwebservices.rest.maxResultsDefault(50 by default). An optional dependency on a backend module listed on a later page never turned on its feature flag, so the features behind it stayed hidden without any error.setupOptionalDependenciesnow loads the module list withopenmrsFetchAll(#2019), which follows thenextlinks.openmrsFetchAllrejects if any page fails, so if a later page fails to load, no flags are set, including ones for modules on the first page. Previously a failed request also set no flags, so this keeps the existing all-or-nothing behaviour.The implementer tools part of O3-4646 was already fixed by #1463, so this PR completes the ticket.
Screenshots
No UI change.
Related Issue
https://openmrs.atlassian.net/browse/O3-4646
Other
optionaldeps.tshad no tests.optionaldeps.test.tsruns the realopenmrsFetchAllagainst a mockedopenmrsFetchand covers: