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

Dev - iOS app crashes on magic code input #18874

Closed
1 of 6 tasks
kavimuru opened this issue May 12, 2023 · 31 comments
Closed
1 of 6 tasks

Dev - iOS app crashes on magic code input #18874

kavimuru opened this issue May 12, 2023 · 31 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Needs Reproduction Reproducible steps needed

Comments

@kavimuru
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. logout if already logged in
  2. Enter email
  3. Double click any number on each magic code input

Expected Result:

App doesn't crash

Actual Result:

App crashes on 5th input

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: v1.3.13-1
Reproducible in staging?: needs reproduction
Reproducible in production?: needs reproduction
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation

crash.mp4

Expensify/Expensify Issue URL:
Issue reported by: @situchan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683872743466849

View all open jobs on GitHub

@kavimuru kavimuru added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels May 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

Triggered auto assignment to @kadiealexander (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented May 12, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@situchan
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

iOS app crashes on magic code input

What is the root cause of that problem?

After enter full 6 numbers, set focusedIndex to undefined to blur the input:

setFocusedIndex(undefined);

And this makes editIndex undefined when Backspace press event is unnecessarily called (known bug) here:

setEditIndex(focusedIndex);

And this effect is called again since it has props.value as a dependency

And finally crashes on this line:

inputRefs.current[editIndex].blur();

because inputRefs.current[undefined] = undefined

What changes do you think we should make in order to solve the problem?

Add _.isUndefined(editIndex) || condition in early return condition

@melvin-bot melvin-bot bot added the Overdue label May 15, 2023
@kadiealexander
Copy link
Contributor

@situchan, I'm not able to reproduce this on the latest version (1.3.14-0)

RPReplay_Final1684215315.MP4

Could you please test on the latest version of the app, and share updated reproduction steps if you're still running into it?

@BeeMargarida
Copy link
Contributor

I think this only happens in iOS 16.4 simulators. I think this issue is actually related to this one - #18218

@situchan
Copy link
Contributor

@kadiealexander as the title says, this happens only in developer mode and iOS 16.4 simulator. Not reproducible on staging/production.

@kadiealexander
Copy link
Contributor

I can't get the keyboard to appear on my dev simulator.

2023-05-17_17-46-05.mp4

Asking for someone else to test here.

@situchan
Copy link
Contributor

@kadiealexander from your video, iOS version is 16.2 so not reproducible. Only happens on 16.4

@kadiealexander
Copy link
Contributor

Adding the engineering label to get some help reproducing this one, my version of XCode doesn't allow for simulating iOS 16.4 :(

@melvin-bot
Copy link

melvin-bot bot commented May 19, 2023

Triggered auto assignment to @aldo-expensify (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@kadiealexander
Copy link
Contributor

@aldo-expensify could you please take a look and help me reproduce this in a iOS 16.4 simulator? I am having trouble with mine and don't want this to stay blocked on me.

@aldo-expensify
Copy link
Contributor

I'm trying too, but I'm having problems with IOS in my dev environment at the moment :(

@aldo-expensify
Copy link
Contributor

@aldo-expensify could you please take a look and help me reproduce this in a iOS 16.4 simulator? I am having trouble with mine and don't want this to stay blocked on me.

I got my simulator working now. I was having this problem with my env: https://stackoverflow.com/questions/68565356/xcrun-error-sdk-iphoneos-cannot-be-located

Posting in case it is useful for you.

@aldo-expensify
Copy link
Contributor

@situchan I don't see an IOS 16.4 simulator in Xcode to test this. Are you using a simulator or a real device?

image

@situchan
Copy link
Contributor

@aldo-expensify it seems you're still using old Xcode version.
My Xcode is v14.3

@aldo-expensify
Copy link
Contributor

Is My Xcode is v14.3 working fine now? Did you have to modify something to make it work? I remember I had to downgrade back to v14.2 some time ago to get the project working again.

@situchan
Copy link
Contributor

situchan commented May 19, 2023

This workaround works for me. So I have no problem using 14.3

image

@aldo-expensify
Copy link
Contributor

Thanks, I'll give that a try later 😬

@melvin-bot melvin-bot bot added the Overdue label May 22, 2023
@kadiealexander
Copy link
Contributor

Have asked for help reproducing this here.

@melvin-bot melvin-bot bot removed the Overdue label May 23, 2023
@situchan
Copy link
Contributor

Another person reproduced and uploaded video: #18218 (comment)

@kadiealexander
Copy link
Contributor

Thanks @situchan! Checking in that issue to see if this is a dupe.

@s77rt
Copy link
Contributor

s77rt commented May 24, 2023

@situchan I see that the key to reproduce the bug is the unnecessary Backspace press event, so if that event didn't exist the issue won't be reproducible, is that the case? If so then we should hold on #18218 (or close the issue - same root cause).

cc @kadiealexander

@situchan
Copy link
Contributor

yes but fixing crash at least unblocks development and testing on iOS simulator which is @tgolen's concern.
After that, #18218 may exist longer.

@s77rt
Copy link
Contributor

s77rt commented May 24, 2023

Good point but we don't have to test on iOS 16.4. You can still test using other iOS versions.

@aldo-expensify
Copy link
Contributor

Good point @s77rt , and #18218 looks a lot more annoying than this one, and this one should get resolved once we get #18218 fixed.

Closing as duplicate.

@aimane-chnaif
Copy link
Contributor

This bug is still happening to me on iOS 16.4 simulator

Screen.Recording.2023-08-18.at.11.53.38.PM.mov

another case:

#23060 (comment)

Can we re-open this and fix?

cc: @BeeMargarida @s77rt @aldo-expensify @tgolen

@s77rt
Copy link
Contributor

s77rt commented Aug 21, 2023

@aimane-chnaif Seems working fine from my end. Please double check your pod and project files against these changes https://github.com/Expensify/App/pull/21316/files

Kooha-2023-08-21-15-04-44.mp4

@aimane-chnaif
Copy link
Contributor

Checked already.
Note: I reinstalled macOS and cloned fresh repo so there might be additional configuration which is not added to git

@BeeMargarida
Copy link
Contributor

@aimane-chnaif Double checked right now, I ran npm run clean and installed the pods, everything is working correctly.

@aimane-chnaif
Copy link
Contributor

@aimane-chnaif Double checked right now, I ran npm run clean and installed the pods, everything is working correctly.

Did you run build using command or from Xcode? I used Xcode

@BeeMargarida
Copy link
Contributor

@aimane-chnaif Double checked right now, I ran npm run clean and installed the pods, everything is working correctly.

Did you run build using command or from Xcode? I used Xcode

Using npm run ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering Needs Reproduction Reproducible steps needed
Projects
None yet
Development

No branches or pull requests

7 participants