-
Notifications
You must be signed in to change notification settings - Fork 359
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 crash when feature's id is missing from feature_types #3553
Conversation
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@Ashesh3 https://deploy-preview-3553--care-net.netlify.app/facility/dbfac015-0556-4450-8435-20bf3d97bc14 now, the search got ready, but when the facility button is clicked, it is crashing there, can you check indetail |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@nihal467 Should be fixed now. Somehow the facility "test-nihal-001" has a feature which doesn't exist (ID 6). This shouldn't be possible as the frontend has no option to set a feature with ID 6 during asset creation. Maybe there needs to be checks on the backend to disallow such invalid values. |
@Ashesh3 can you please raise an issue about this in the backend? |
Sure! |
@khavinshankar The backend does have proper validation for feature ids. This issue seemed to be due to an inconsistency between the features mapping on the backend and frontend. Backend:
Frontend:
Feature "Blood Bank" with id Issue (Addition of Blood Bank): #3469 The below two PRs ideally should have been merged together: But it seems that the backend change was merged but the frontend lagged behind, which caused this issue. |
@Ashesh3 @khavinshankar it is working now, do we need this PR or close it? |
We still need this PR to fix it, This adds a conditional check to not print attributes which do not exist. This should make the care platform more robust and crash proof. This will ensure that crashes do not happen in future even if backend and frontend are not in sync (which is the case currently even now). |
Fix #3552
The search results page crashes when a facility has a feature whose id is not mapped in the
FACILITY_FEATURE_TYPES
. This PR adds a safe check for existence before accessing the feature's properties.