Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and upgrade to RN 0.76.5 #8421

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Update dependencies and upgrade to RN 0.76.5 #8421

wants to merge 17 commits into from

Conversation

enahum
Copy link
Contributor

@enahum enahum commented Dec 17, 2024

Summary

Upgrade all dependencies (the app should be tested in its entirety) and upgraded to React Native 0.76.5, still blocked to switch to the new arch by the navigation library

Ticket Link

https://mattermost.atlassian.net/browse/MM-60562

Release Note

NONE

@enahum enahum added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Dec 17, 2024
Copy link
Contributor

@larkox larkox left a comment

Choose a reason for hiding this comment

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

Some nitpicks here and there, but nothing really blocking.

@@ -60,7 +60,7 @@ const BookmarkIcon = ({emoji, emojiSize, emojiStyle, file, genericStyle, iconSiz
name='book-outline'
size={22}
color={theme.centerChannelColor}
style={genericStyle}
style={genericStyle as StyleProp<TextStyle>}
Copy link
Contributor

Choose a reason for hiding this comment

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

In several files we are doing this, and the prop is only used to then be casted. Shouldn't we change the type directly in the prop?


useEffect(() => {
if (files.length) {
containerHeight.value = CONTAINER_HEIGHT_MAX;
return;
}
containerHeight.value = CONTAINER_HEIGHT_MIN;
}, [files.length > 0]);
}, [containerHeight, files.length]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick:

If we create a new variable hasFiles, we might not run this effect so often, and may be slightly more intention revealing. (Not that this is neither hard to understand or has any performance issue though)

const hasFiles = Boolean(files.length);

useEffect(() => {
    if (hasFiles) {...}
    ...
}, [containerHeight, hasFiles]);

@@ -13,7 +13,7 @@ import {typography} from '@utils/typography';

type DateSeparatorProps = {
date: number | Date;
style?: StyleProp<ViewStyle>;
style?: StyleProp<TextStyle>;
Copy link
Contributor

Choose a reason for hiding this comment

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

In order to make this type safe, you can use the Intersection utility type we have like this:

style?: StyleProp<Intersection<TextStyle, ViewStyle>>;

That way, we don't need the casting, and we make sure we don't pass styles that may create issues.

@@ -130,7 +130,7 @@ const PostList = ({
return false;
}
return posts[0]?.id !== lastPostId;
}, [posts[0]?.id, lastPostId]);
}, [lastPostId, posts]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably this memo is not needed at all (it is memoizing a boolean value and doing a pretty fast operation). But 0/5 on whether it is desirable to change it in this PR.

"cursor": undefined,
},
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit surprised of these snapshots changing. Do you know where is this change coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this can be caused by the upgrade of react-native-gesture-handler library or the update to react-native or react, this is defo not done by us.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is another reason why I think snapshots are silly.

Comment on lines 16 to 17
afterAll(() => {
// jest.resetAllMocks();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer needed? If so, should we just remove it?

@@ -70,15 +70,15 @@ export const getFullErrorMessage = (error: unknown, intl?: IntlShape, depth = 0)
return `${message}; ${getFullErrorMessage(error.details, intl, depth + 1)}`;
}

return message;
return message!;
Copy link
Contributor

Choose a reason for hiding this comment

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

What is causing us to need this? Same on line 81. We should add some default value instead of using the !.

@yasserfaraazkhan yasserfaraazkhan added the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 5, 2025
@github-actions github-actions bot removed the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 5, 2025
@yasserfaraazkhan yasserfaraazkhan added the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 6, 2025
@github-actions github-actions bot removed the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 6, 2025
@yasserfaraazkhan yasserfaraazkhan added the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 6, 2025
@github-actions github-actions bot removed the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 6, 2025
@yasserfaraazkhan yasserfaraazkhan added the Build Apps for PR Build the mobile app for iOS and Android to test label Jan 6, 2025
Copy link
Contributor

@rahimrahman rahimrahman left a comment

Choose a reason for hiding this comment

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

There are a lot of changes in here. I feel like in the future it is better to compartmentalize changes into smaller PRs. I see changes that correspond to react-native upgrade, and changes to linting errors, and anything else in between.

My $0.02.

"cursor": undefined,
},
]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is another reason why I think snapshots are silly.

@@ -114,7 +114,7 @@ const AnnouncementBanner = ({
snapPoints: [1, snapPoint],
theme,
});
}, [theme.sidebarHeaderTextColor, intl.locale, renderContent, allowDismissal]);
}, [intl, allowDismissal, renderContent, theme]);
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 guessing this (and others) is more of a lint error vs react-native upgrade?

@rahimrahman rahimrahman added the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 7, 2025
@github-actions github-actions bot removed the E2E iOS tests for PR Run iOS E2E Detox tests label Jan 7, 2025
@rahimrahman
Copy link
Contributor

@yasserfaraazkhan ping. Can you do a smoke test on this? I see the E2E with iOS has passed, but can you check on Android?

There's a growing demand to get this through.

@yasserfaraazkhan
Copy link
Contributor

@yasserfaraazkhan ping. Can you do a smoke test on this? I see the E2E with iOS has passed, but can you check on Android?

There's a growing demand to get this through.

Hi @rahimrahman
I'll work on android device. I've done the iOS device tests. (posted an update here)

@yasserfaraazkhan yasserfaraazkhan added Build App for iOS Build the mobile app for iOS and removed Build Apps for PR Build the mobile app for iOS and Android to test labels Jan 9, 2025
@yasserfaraazkhan
Copy link
Contributor

yasserfaraazkhan commented Jan 9, 2025

Observed defect on android

@rahimrahman
Copy link
Contributor

Thanks for testing. I'm not as worried about the issue you found, whether it's caused by this or something completely different since it's not blocking. But I will take a look at it nevertheless.

@rahimrahman rahimrahman added this to the v2.24.0 milestone Jan 9, 2025
@amyblais amyblais modified the milestones: v2.24.0, v2.25.0 Jan 9, 2025
@rahimrahman
Copy link
Contributor

/update-branch

@lindalumitchell
Copy link
Contributor

lindalumitchell commented Jan 10, 2025

@rahimrahman @yasserfaraazkhan I tried installing from the PR build as posted here and also the previously built one here, but in both cases the app doesn't launch successfully. It installs, and I tap the icon to launch, it flashes/blurs the screen for a moment, then it returns to the state before I tapped. I can't get the app to launch. Am I missing something obvious here? Are others able to install and launch the PR build for iOS?

I see this issue on both iPhone 13 Pro Max with iOS 18.2 and also iPad Pro 11-inch with iOS 18.1.1 (tried twice with each).

iPhone-Mm-doesnt-launch.mp4

@yasserfaraazkhan
Copy link
Contributor

Hi @lindalumitchell @rahimrahman
I think its an issue with latest iOS. I had tried it on simulator with 17.5 iOS version and saw the same. It works on 17.1, 17.2 version.

It might be blocker for latest versions.

@rahimrahman
Copy link
Contributor

@lindy65 @yasserfaraazkhan I have this running on iPhone 15 simulator on 17.5 and iPhone 16 Max simulator on 18.2. I will try in the AM again on real devices. I have devices running on 17.x and 18.2.1.

I just updated the branch with main. I'm going to build the app again with the latest merged into it. Don't think it will make a difference, but let's see what happens here.

@rahimrahman rahimrahman added Build Apps for PR Build the mobile app for iOS and Android to test and removed Build App for iOS Build the mobile app for iOS labels Jan 10, 2025
@lindalumitchell
Copy link
Contributor

Thanks @rahimrahman , I'm afraid you're right -- I tried on the new PR build and the issue is still there and the app won't launch.

@lindalumitchell lindalumitchell self-requested a review January 10, 2025 23:55
@lindalumitchell
Copy link
Contributor

(I added myself as a reviewer to help keep this on my radar next week. For anyone reading this, I'll be doing smoke tests on iPad to round out the testing.)

@rahimrahman rahimrahman added Build Apps for PR Build the mobile app for iOS and Android to test and removed Build Apps for PR Build the mobile app for iOS and Android to test labels Jan 11, 2025
@rahimrahman
Copy link
Contributor

@lindalumitchell @yasserfaraazkhan I think I found the culprit and pushed the fix. It is building. I will verify it with my devices (18.2, I appreciate the testing on this and catching the issue. It is not a problem when doing an install on top of older version, but it is a problem on new install (hard install).

It works on iPhone 15 simulator 17.5.

@rahimrahman rahimrahman added Build Apps for PR Build the mobile app for iOS and Android to test and removed Build Apps for PR Build the mobile app for iOS and Android to test labels Jan 11, 2025
@rahimrahman
Copy link
Contributor

This is my iPhone X running 16.x. So probably not a valid test. But for the record.

RPReplay_Final1736620562.MP4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester Build Apps for PR Build the mobile app for iOS and Android to test release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants