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 + noImplicitAny #11179

Merged
merged 10 commits into from
Jul 4, 2023

Conversation

t3chguy
Copy link
Member

@t3chguy t3chguy commented Jul 3, 2023

Requires matrix-org/matrix-js-sdk#3537


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 Jul 3, 2023
The snapshot was wrong, it was showing the state for a mismatched email
@t3chguy t3chguy marked this pull request as ready for review July 4, 2023 08:29
@t3chguy t3chguy requested a review from a team as a code owner July 4, 2023 08:29
Copy link
Contributor

@germain-gg germain-gg left a comment

Choose a reason for hiding this comment

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

Approving and happy for it to be merged once the snap comment has been addressed 👍

Exciting to have almost all strict errors fixed 👏

if (!lookup || !lookup.mxid) {
if (!lookup || !("mxid" in lookup)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sure this is valid, but i'm not sure i understand what rule it's conforming to?

Copy link
Member Author

@t3chguy t3chguy Jul 4, 2023

Choose a reason for hiding this comment

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

Its because the return type is {} | { mxid: string; ... } so to make TS happy we can't just do !lookup.mxid as {}.mxid is invalid. So we have to use in for narrowing

This invite to RoomPreviewBar-test-room was sent to test@test.com
Do you want to join RoomPreviewBar-test-room?
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we expecting this change in the snapshot? It looks like what it prints does not match the test name anymore, could we update it?

Copy link
Member Author

@t3chguy t3chguy Jul 4, 2023

Choose a reason for hiding this comment

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

Yes. It does actually match, it was wrong before. The test name is renders invite message when invite email mxid match yet it was the same snapshot as renders email mismatch message when invite email mxid *doesnt* match. When the email matches it should be treated as a normal invite, removing the complexity of email invites.

@t3chguy t3chguy merged commit a294ba2 into develop Jul 4, 2023
17 checks passed
@t3chguy t3chguy deleted the t3chguy/types/3jul23 branch July 4, 2023 13:49
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.

2 participants