Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.98k stars 2.98k forks source link

[CP Staging] fix: remove using StatusBar height #55082

Closed WoLewicki closed 2 weeks ago

WoLewicki commented 2 weeks ago

Explanation of Change

In scenario when the HybridApp is freshly installed, there is a bug that when the OD is starting, at the same time RN activity is run, resolving in executing the JS bundle which in turn loads modules. One of them (probably more so until we find a fix for early RN start, bugs can appear quite randomly), StatusBar, needs currentActivity to get its height: https://github.com/facebook/react-native/blob/fd0894b1c7fcb20dd213ec1e93aafef25935d709/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt#L49. It fails due to activity not being visible (?) so it returns 0 as its height. This value is then read in the file changed by the PR, resulting in no top padding.

I couldn't find a reason why those values are used at all when we have SafeAreaProvider that returns correct values, so I just removed it for now. cc @hannojg @chrispader since I saw you touched that code recently (https://github.com/Expensify/App/pull/53223).

Hopefully it fixes the same issue that happens only on ND, maybe those values are incorrect there too in some weird scenarios. Please try and test it.

Fixed Issues

$ https://github.com/Expensify/App/issues/54988 PROPOSAL:

Tests

  1. Launch hybrid app.
  2. Log in to a new Expensifail account.
  3. After logging in, kill the app.
  4. Relaunch the app.
  5. Kill app and relaunch app several times because sometimes app launches without issue.
  6. App will not overlap with status bar after killing app and relaunching app.

Offline tests

N/A

QA Steps

N/A // TODO: These must be filled out, or the issue title must include "[No QA]."

PR Author Checklist

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
melvin-bot[bot] commented 2 weeks ago

@ZhenjaHorbach Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

ZhenjaHorbach commented 2 weeks ago

Reviewer Checklist

Screenshots/Videos

Android: Native https://github.com/user-attachments/assets/ad5b44b2-629a-4596-84ab-e68576249cb2
Android: mWeb Chrome NA
iOS: Native NA
iOS: mWeb Safari NA
MacOS: Chrome / Safari NA
MacOS: Desktop NA
ZhenjaHorbach commented 2 weeks ago

It really works !

https://github.com/user-attachments/assets/ad5b44b2-629a-4596-84ab-e68576249cb2

github-actions[bot] commented 2 weeks ago

🚧 @mountiny has triggered a test build. You can view the workflow run here.

github-actions[bot] commented 2 weeks ago
:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube: Android :robot: iOS :apple:
https://ad-hoc-expensify-cash.s3.amazonaws.com/android/55082/index.html ❌ FAILED ❌
Android The QR code can't be generated, because the iOS build failed
Desktop :computer: Web :spider_web:
https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/55082/NewExpensify.dmg https://55082.pr-testing.expensify.com
Desktop Web

:eyes: View the workflow run that generated this build :eyes:

OSBotify commented 2 weeks ago

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

github-actions[bot] commented 2 weeks ago

🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 9.0.83-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅
🤖🔄 android HybridApp 🤖🔄 failure ❌
🍎🔄 iOS HybridApp 🍎🔄 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

github-actions[bot] commented 2 weeks ago

🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.83-5 🚀

platform result
🤖 android 🤖 true ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅
🤖🔄 android HybridApp 🤖🔄 failure ❌
🍎🔄 iOS HybridApp 🍎🔄 success ✅
github-actions[bot] commented 1 week ago

🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.83-5 🚀

platform result
🤖 android 🤖 true ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅
🤖🔄 android HybridApp 🤖🔄 failure ❌
🍎🔄 iOS HybridApp 🍎🔄 success ✅