kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.67k stars 71 forks source link

Frame drop on App Store and Test Flight version #641

Closed matinzd closed 21 minutes ago

matinzd commented 4 days ago

Describe the bug

There is a frame drop issue present in app store and test flight build that is not present either in debug or release mode from xcode. I don't actually know what's going on that can affect the appstore or test flight build.

Code snippet

It's the same issue in all the places I use but this is the related code in that I recorded video from.

import { KeyboardAvoidingView } from 'react-native-keyboard-controller';

<KeyboardAvoidingView
  keyboardVerticalOffset={Platform.select({ ios: 100, android: 16 })}
  behavior="position"
>
  <Box px={'m'} gap={'s'}>
    <AppText variant={'h2Medium'}>
      {t('settings:account_deletion.title')}
    </AppText>
    <AppText variant={'bodyRegularSmall'}>
      {t('settings:account_deletion.subtitle')}
    </AppText>

    {ACCOUNT_DELETION_ISSUES.map((issue) => (
      <PressableBounce
        p={'s12'}
        justifyContent={'space-between'}
        alignItems={'center'}
        flexDirection={'row'}
        key={issue}
        onPress={onValueChange.bind(null, issue)}
      >
        <AppText
          variant={'bodyRegularSmall'}
          color={'black_10'}
          style={{ flex: 1 }}
        >
          {t(`settings:account_deletion.issues.${issue}`)}
        </AppText>
        <Spacer size={12} />
        <Checkbox
          value={selectedIssues.has(issue)}
          onValueChange={onValueChange.bind(null, issue)}
        />
      </PressableBounce>
    ))}

    <Spacer size={4} />

    <AppText variant={'bodyRegularSmall'}>
      {t('settings:account_deletion.open_feedback')}
    </AppText>

    <TextInput
      multiline
      onChangeText={setOpenFeedback}
      textAlignVertical="top"
      style={{
        height: 100,
        padding: 12,
        marginTop: 4,
        borderWidth: 1,
        borderRadius: 8,
        borderColor: colors.gray_50,
      }}
      placeholder={t('common:optional')}
    />

    <Spacer size={8} />
    <AppButton
      text={t('settings:account_deletion.proceed')}
      onPress={deleteAccount}
      type={'highEmphasisDestructive'}
      loading={accountDeletionPending}
    />
    <AppButton
      text={t('common:not_now')}
      onPress={() => navigation.goBack()}
      type={'lowEmphasis'}
      loading={accountDeletionPending}
    />
  </Box>
</KeyboardAvoidingView>

Repo for reproducing

I will try my best to create a reproducible

To Reproduce Steps to reproduce the behavior:

  1. Create release build and send it to test flight
  2. See if you have frame drops

Expected behavior

No frame drops or flickering

Screenshots

Debug and Release Build on Xcode Release build on App Store and Test Flight

Smartphone (please complete the following information):

Additional context

kirillzyusko commented 4 days ago

@matinzd interesting! Do you test XCode version with the cable connected to the phone and computer? Have you tried to test release version without cable?

I'm just thinking that phone with a connected USB cable can be charging from computer and thus may have bigger CPU frequency etc. and because of that you don't have any lags. (just an assumption, but want to check with you).

I also feel like that issue may require intensive communication between us, so maybe you have a Discord account where we can chat? 👀

matinzd commented 4 days ago

Do you test XCode version with the cable connected to the phone and computer? Have you tried to test release version without cable?

I am using wireless build and my phone is connected to the same network. It doesn't matter if I build in debug or release it's smooth but as soon as CI releases the version to TestFlight it starts stuttering :D

I also feel like that issue may require intensive communication between us, so maybe you have a Discord account where we can chat? 👀

Hit me on Discord with username matinzd. I also messaged you on Twitter.

matinzd commented 4 days ago

I have a hypothesis that maybe CI is building the app with xcode 16. I will check with xcode 15 to see if that fixes the issue. Then we know that something is happening while compiling with xcode 16.

matinzd commented 4 days ago

UPDATE

Sentry integration was messing with all the animations in the app. If anyone is having the same issue try setting this option inside the init function of sentry.

enableStallTracking: false

I will list some issues that may be related:

https://github.com/getsentry/sentry-react-native/issues/3987 https://github.com/software-mansion/react-native-reanimated/issues/5671

matinzd commented 3 days ago

The issue is fixed in sentry v6 (which was dropped yesterday) with the new stall tracking integration:

https://github.com/getsentry/sentry-react-native/pull/3997

hirbod commented 2 hours ago

Great find @matinzd 🙏

kirillzyusko commented 22 minutes ago

Thank you for investigation @matinzd!

Since it's not a problem of this library I'm going to close this issue. Really appreciate your time and involvement in resolving this problem ❤️

If you think that I should add a note about this problem in documentation somewhere - let me know and I'll do it!

matinzd commented 8 minutes ago

Yes! I guess it makes sense to inform users about this issue on Sentry v5.