⚠️ fix: housing type nullable#322
Merged
Merged
Conversation
3f26d84 to
3cad5d6
Compare
Contributor
Author
|
Closed for precaution as this PR just contains the summary of the changes and is not intended to be merged without the branch first being released and this branch this PR is made of rebased accordingly. At least thats what I think should happen 😅 |
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.
This PR contains a fix for a bug reported yesterday 2025-07-01
Context:
One user couldn't save their application profile on mimer.nu when prompted before making a note of interest on an apartment. I believe the issue is they have some obscure combo of old phone(!) and browser, making the select input boxes not rendering under the text
...resulting in the form not submitting because of this value missing.
The user calls CS and asks for help updating their profile. CS visits medarbetarportalen, searches the user and tries to update their profile. This is where the error adressed in this PR occurs.
Problem is that during onecore-core internal logic that compares the optionally existing profile and the incoming update parameters, we parse the existing profile with a schema that expects
profile.housingTypeto be not null.If the user has never successfully updated their own information (like in this case),
profile.housingTypeis in fact null. This results in a zod parsing exception, giving response 500 back to internal portal.Solution
In the helper function we use to construct update payloads based on incoming profile and existing profile, allow null
profile.housingTypewhen comparing existing and incoming profile.I also added some comments to existing fuctions and refactored/renamed stuff a bit in an attempt to clarify intent.
PR is probably easier to understand if read commit by commit.
The branch that this PR is based on,
fix/housing-typeis based on the release commit 1.0.230. I think I've done that correctly to prepare the branch as a hotfix release so it's based on the latest prod release, not incorporating any other changes tomainsince then.We decided to wait with releasing this mainly because: