Skip to content

⚠️ fix: housing type nullable#322

Merged
osirisguitar merged 5 commits into
mainfrom
fix/housing-type
Jul 14, 2025
Merged

⚠️ fix: housing type nullable#322
osirisguitar merged 5 commits into
mainfrom
fix/housing-type

Conversation

@momentiris

@momentiris momentiris commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

⚠️ Do not merge before understanding the description below

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

Du har tidigare angett att ni är en (1) person i hushållet. Stämmer det för din ansökan

...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.housingType to be not null.

If the user has never successfully updated their own information (like in this case), profile.housingType is 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.housingType when 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-type is 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 to main since then.

We decided to wait with releasing this mainly because:

  • At the time of writing, we (us that are currently working) are not super comfortable with release/hotfix/release/rollback procedure.
  • We think it's an rather unusual scenario that likely will not cause a lot of problems until more people are back from vacation and we feel more comfortable releasing this.

@momentiris momentiris changed the title fix: housing type nullable ⚠️ fix: housing type nullable Jul 2, 2025
@momentiris momentiris closed this Jul 2, 2025
@momentiris

momentiris commented Jul 2, 2025

Copy link
Copy Markdown
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 😅

@momentiris momentiris reopened this Jul 2, 2025
@momentiris momentiris closed this Jul 2, 2025
@osirisguitar osirisguitar reopened this Jul 14, 2025
@osirisguitar osirisguitar merged commit 5d1f6d1 into main Jul 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants