Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Conform more of the codebase to strictNullChecks #10738

Merged
merged 9 commits into from
May 9, 2023
Merged

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Apr 28, 2023

Requires matrix-org/matrix-react-sdk-module-api#15
Requires matrix-org/matrix-js-sdk#3330
Fixes element-hq/element-web#24752


This change is marked as an internal change (Task), so will not be included in the changelog.

@t3chguy t3chguy added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Apr 28, 2023
@t3chguy t3chguy self-assigned this Apr 28, 2023
src/LegacyCallHandler.tsx Outdated Show resolved Hide resolved
src/LegacyCallHandler.tsx Outdated Show resolved Hide resolved
src/components/structures/RightPanel.tsx Outdated Show resolved Hide resolved
permalinkCreator={this.props.permalinkCreator}
/>
);
if (roomId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (roomId) {
if (!!roomId && !!this.props.permalinkCreator) {

(to fix implicit boolean cast, and type failure on permalinkCreator)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I specifically didn't touch permalinkCreator as there are multiple related type fails around the code and it may be intentional that it can be passed as undefined

@@ -1087,7 +1087,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
case "picture_snapshot":
ContentMessages.sharedInstance().sendContentListToRoom(
[payload.file],
this.state.room.roomId,
this.getRoomId(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is still failing. Likewise various similar references below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentional, consolidates everything to use this single method which in future will be made non-optional and to throw an error if no roomId so it is picked up by the error boundary

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was deferred to a later task, this just consolidates the handling

src/components/views/rooms/EventTile.tsx Show resolved Hide resolved
@t3chguy t3chguy requested a review from richvdh May 5, 2023 10:38
 into t3chguy/tsc-stricto

# Conflicts:
#	src/components/views/settings/Notifications.tsx
#	src/components/views/settings/ProfileSettings.tsx
#	src/components/views/settings/SecureBackupPanel.tsx
 into t3chguy/tsc-stricto

# Conflicts:
#	src/LegacyCallHandler.tsx
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks plausible, but the merge makes it difficult to review changes since the last review, and I don't want to have to go through the whole lot all over again. Could you keep these PRs smaller please? It's difficult for reviewers to juggle this much state.

@t3chguy t3chguy merged commit 52017f6 into develop May 9, 2023
@t3chguy t3chguy deleted the t3chguy/tsc-stricto branch May 9, 2023 17:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply strictNullChecks to src/components/views/right_panel/*
2 participants