Fix camera not working on the second time opening it#53194
Fix camera not working on the second time opening it#53194techievivek merged 9 commits intoExpensify:mainfrom
Conversation
|
@ishpaul777 This PR is almost ready, but two issues remain:
screenRecording-28-11-2024-1-33.mp4 |
|
@ishpaul777 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] |
|
@ishpaul777 I need your guidance on whether the two mentioned issues are blockers for this PR and the next steps. |
I think this is not related to this PR so treat it is as NAB, but if you can found a fix and fix is straightforward, lets fix it as well
this one looks like blocker becuase this is exact thing are trying to fix |
|
@ishpaul777 The two related issues seem resolved. |
|
@QichenZhu Could you add some details on what was the problem and how these changes fix it? |
|
@ishpaul777 Sure! Actually, there were 3 (maybe 4) different problems. 1. Main issue #51337
2. Random camera crash on some old iOS versionsSometimes the camera started normally but stopped working within one second. Reproducible in Safari and Chrome on iOS 17.5 and 17.7.2 but seems resolved on iOS 18. I suspect the camera view resized on startup, causing iOS to fail rendering it. Fixed by setting 3. Cropped camera viewI think this was just another form of the same issue as above on different iOS versions. 4. Random camera init failure in ChromeSafari and Chrome behaved differently because |
Reviewer Checklist
Screenshots/VideosAndroid: NativeRecord_2024-12-04-04-11-39.mp4Android: mWeb ChromeRecord_2024-12-04-03-33-37.mp4iOS: Nativetrim.96E08D14-F849-4ABF-9FF3-B48F5E552A2F.MOViOS: mWeb Safaritrim.2335DA68-7255-4C5E-B6F2-B3526CF4D171.MOVtrim.5C14B610-93F3-4C06-94FD-629CF38434E2.MOVMacOS: Chrome / SafariCamera feature not available on desktop MacOS: DesktopCamera feature not available on desktop |
|
Bug: App crashes on android when navigating back after scanning receipt Record_2024-12-04-03-39-03.mp4 |
@ishpaul777 This PR only changes web files and types, so it's unlikely to cause this. I just tested merging this PR into |
|
Yea please lets try merging main |
|
okay seems to eb resolved after merging main 👍, please update author checklist it seems to be changed recently |
|
Thanks! Checklist updated. |
|
Can you please add unit tests ? https://expensify.enterprise.slack.com/archives/C01GTK53T8Q/p1733148961659549 |
1 similar comment
|
Can you please add unit tests ? https://expensify.enterprise.slack.com/archives/C01GTK53T8Q/p1733148961659549 |
I suggest not adding unit tests because: 1. The main issue and other related issues require running on specific iOS versions on physical devices to reproduce, which is not practical to mock. 2. The main issue can be easily caught by eslint if we hadn't suppressed the warning. This PR removes the suppression, so unit tests wouldn't really add much value. |
|
@techievivek Do you agree with ^ reasoning to not add unit tests for this bug fix, it makes sense to me but i defer decision to you 🙇 Thanks! |
|
Yes, I think we can skip this since it’s an iOS-specific version issue. As @QichenZhu mentioned, this could have been caught by the linter itself, and now since we have already removed the suppression, that is fine. |
|
I have checked off |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/techievivek in version: 9.0.72-0 🚀
|
|
🚀 Deployed to staging by https://github.com/techievivek in version: 9.0.72-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.0.72-1 🚀
|
| return ( | ||
| <View> | ||
| // Hide the camera during initialization to prevent random failures on some iOS versions. | ||
| <View style={isInitialized ? styles.dFlex : styles.dNone}> |
Explanation of Change
Fixed Issues
$ #51337
PROPOSAL: #51337 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android-native.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios-native.mp4
iOS: mWeb Safari
ios-safari.mp4
ios-chrome.mp4
MacOS: Chrome / Safari (Not Applicable)
Test steps are not applicable on this platform.
MacOS: Desktop (Not Applicable)
Test steps are not applicable on this platform.