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: handle empty user roles response [DHIS2-15368] #1215

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

tomzemp
Copy link
Member

@tomzemp tomzemp commented Jun 19, 2023

See https://dhis2.atlassian.net/jira/software/c/projects/DHIS2/issues/DHIS2-15368

Front end expects response from api/user/{uid} to contain an object userCredentials which contains an array userRoles. However, when there are no userRoles, userCredentials does not contain the property userRoles, and hence causes the app to crash (tries to map non-existent userRoles array)

This arguably might be something the backend should change, but updating the front-end also is sufficient for the immediate purpose of stopping the app from crashing.

Note: we decided in our meeting on 20 June that we would fix this on the front end and backend team will evaluate if they also want to do anything here.

@dhis2-bot
Copy link
Contributor

🚀 Deployed on https://pr-1215--dhis2-user.netlify.app

@tomzemp tomzemp changed the title fix: handle empty user roles response fix: handle empty user roles response [DHIS2-15368] Jun 22, 2023
@tomzemp tomzemp marked this pull request as ready for review June 22, 2023 10:58
@tomzemp tomzemp requested a review from a team June 22, 2023 11:00
@tomzemp tomzemp merged commit 0cf0218 into master Jun 26, 2023
@tomzemp tomzemp deleted the DHIS2-15368/empty-user-roles branch June 26, 2023 12:52
dhis2-bot added a commit that referenced this pull request Jun 26, 2023
## [1.5.19](v1.5.18...v1.5.19) (2023-06-26)

### Bug Fixes

* handle empty user roles response ([#1215](#1215)) ([0cf0218](0cf0218))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.5.19 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants