Repository navigation
More reviewed null checks from LLM - #1624
Merged
matkoniecz merged 16 commits intoOct 23, 2026
Merged
Conversation
processCurrentLandUseClassifications and processOriginalLandUseClassifications were declared as returning Promise<any>, which is overly broad: both return the attributes update with the derived land use group and order fields merged in. Declare them as returning Promise<Partial<BuildingAttributes>>, the same type as the update they receive, so that callers keep a checked type instead of any. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It returns undefined when the token is not valid, which the caller already checks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DataContainer renders it unconditionally, including in the category panel shown before any building is selected (e.g. /view/age). It already skips fetching history when no building is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The map colour scale and its setter are owned by MapApp and only passed through DataContainer, which hands them to the wrapped category view from this.props. The copy kept in state was never read. It was also refreshed only when the selected building changed, so after switching map style on the same building it held a stale value. Keeping a single source in props avoids that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It already highlights a building only when one is selected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There is no username when logged out, and the menu then shows the login links instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a data query parameter there is no data and no error, and sending the update failed on the missing edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All of them may be left out, and the service handles that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It calls hasOwnProperty on its argument, which fails for null and undefined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parsing an unset port gave NaN, which pg and nodemailer treat as not given and fall back to their default port; leaving it undefined does the same explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page already shows a loading message until they arrive, and the latest extract is missing when there are none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It is passed to the input as is, and is built from optional flags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The slider marks are built from it, and all sliders give one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A doubled comma left a hole in the list, shown as an empty option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking regressions in these focused type and null-handling changes; tests and builds were not run.
No open issues 🎉
What changed in this PR
This PR improves null handling and TypeScript type accuracy across frontend components, API services, and connection configuration.
Changes:
- Align types with optional values and tighten helper, slider, and service contracts.
- Guard multi-edit updates and port parsing when values are undefined.
- Remove redundant component state and an unintended empty array entry.
| File | Description |
|---|---|
app/src/helpers.ts |
Constrain the property-check helper’s object type. |
app/src/frontend/pages/data-extracts.tsx |
Allow undefined extract state. |
app/src/frontend/map/map.tsx |
Make the selected building ID optional. |
app/src/frontend/map-app.tsx |
Require multi-edit data before sending updates. |
app/src/frontend/header.tsx |
Allow an undefined username. |
app/src/frontend/config/data-fields-config.ts |
Remove an empty date-range array entry. |
app/src/frontend/components/tooltip.tsx |
Explicitly type the interwoven array. |
app/src/frontend/building/edit-history/edit-history.tsx |
Allow undefined history while loading. |
app/src/frontend/building/edit-history/edit-history-latest.tsx |
Model optional data and pass the checked building into the fetch function. |
app/src/frontend/building/data-container.tsx |
Remove redundant map colour scale state. |
app/src/frontend/building/data-components/slider-data-entry.tsx |
Require minimum and maximum bounds. |
app/src/frontend/building/data-components/logical-data-entry/logical-data-entry.tsx |
Make the disabled flag optional. |
app/src/db.ts |
Skip parsing an undefined database port. |
app/src/api/services/passwordReset.ts |
Reflect an undefined token-verification result. |
app/src/api/services/email.ts |
Skip parsing an undefined mail server port. |
app/src/api/services/domainLogic/processBuildingUpdate.ts |
Specify partial building-attribute return types. |
app/src/api/controllers/editHistoryController.ts |
Reflect optional query parameter values. |
Review effort: Balanced
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.
No description provided.