You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading #52633
Version Number: 9.0.63-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers):applausetester+kh051101@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Go to staging.new.expensify.com
Go offline.
Trigger app loading state by going to Troubleshoot > Clear cache and restart > Reset and refresh.
Click on search icon on the top right.
Expected Result:
App will not crash.
Actual Result:
App crashes when clicking on search icon while app is loading.
The return value of this hook is cast as NonNullable<OnyxValue<TOnyxKey>>, then there's no waring when we use like this Object.values(personalDetailsForParticipants)
After that, we can see all waring places via ts error or lint error that possible cause the app crashes when we use the value from the createOnyxContext hook and fix all places.
or if the value here is undefined, we can return a non null value based on the type of OnyxValue<TOnyxKey>. For example, return empty object if this type is an object, return empty array if the type is array,...
changed the title [-]Search - App crashes when clicking on search icon while app is loading[/-][+][$250] Search - App crashes when clicking on search icon while app is loading[/+]on Nov 19, 2024
changed the title [-][$250] Search - App crashes when clicking on search icon while app is loading[/-][+][HOLD for payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/+]on Dec 13, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@alitoshmatov@strepanier03@alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: No discussion
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
I think no regression is needed, it was one off scenario
changed the title [-][HOLD for payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/-][+][Payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/+]on Dec 19, 2024
Activity
melvin-bot commentedon Nov 15, 2024
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.FitseTLT commentedon Nov 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search - App crashes when clicking on search icon while app is loading
What is the root cause of that problem?
The
personalDetailsForParticipantsis null/undefined immediately after clearing cache so it cannot be converted to object hereApp/src/components/Search/SearchRouter/SearchRouter.tsx
Line 126 in 09f6db7
What changes do you think we should make in order to solve the problem?
We should use
or we can use a backup empty object here like this
App/src/pages/RoomMembersPage.tsx
Line 59 in 09f6db7
What alternative solutions did you explore? (Optional)
nkdengineer commentedon Nov 15, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when clicking on search icon while app is loading
What is the root cause of that problem?
After we clear the cache,
personalDetailsForParticipantsbecomeundefinedApp/src/components/Search/SearchRouter/SearchRouter.tsx
Line 122 in a54f913
Then the app crashes here when we open the search page
App/src/components/Search/SearchRouter/SearchRouter.tsx
Lines 126 to 129 in a54f913
But if the
personalDetailsForParticipantsto beundefinedwhy no ts error when we useObject.values(personalDetailsForParticipants)here?App/src/components/Search/SearchRouter/SearchRouter.tsx
Lines 126 to 129 in a54f913
The problem from here,
usePersonalDetailsis a hook context that is created fromcreateOnyxContextApp/src/components/OnyxProvider.tsx
Line 9 in a54f913
The return value of this hook is cast as
NonNullable<OnyxValue<TOnyxKey>>, then there's no waring when we use like thisObject.values(personalDetailsForParticipants)App/src/components/createOnyxContext.tsx
Line 36 in a54f913
App/src/components/createOnyxContext.tsx
Line 90 in a54f913
What changes do you think we should make in order to solve the problem?
To avoid the same case can happen in the feature, we can return the type here as
OnyxValue<TOnyxKey>hereApp/src/components/createOnyxContext.tsx
Line 36 in a54f913
and remove the cast type here
App/src/components/createOnyxContext.tsx
Line 90 in a54f913
After that, we can see all waring places via ts error or lint error that possible cause the app crashes when we use the value from the createOnyxContext hook and fix all places.
or if the value here is
undefined, we can return a non null value based on the type ofOnyxValue<TOnyxKey>. For example, return empty object if this type is an object, return empty array if the type is array,...App/src/components/createOnyxContext.tsx
Line 90 in a54f913
What alternative solutions did you explore? (Optional)
strepanier03 commentedon Nov 19, 2024
Repro'd.
[-]Search - App crashes when clicking on search icon while app is loading[/-][+][$250] Search - App crashes when clicking on search icon while app is loading[/+]melvin-bot commentedon Nov 19, 2024
Job added to Upwork: https://www.upwork.com/jobs/~021858741837244395820
31 remaining items
[-][$250] Search - App crashes when clicking on search icon while app is loading[/-][+][HOLD for payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/+]melvin-bot commentedon Dec 13, 2024
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Dec 13, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.75-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-12-20. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Dec 13, 2024
@alitoshmatov @strepanier03 @alitoshmatov The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
alitoshmatov commentedon Dec 16, 2024
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: https://github.com/Expensify/App/pull/34487/files#r1887152390
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: No discussion
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
I think no regression is needed, it was one off scenario
[-][HOLD for payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/-][+][Payment 2024-12-20] [$250] Search - App crashes when clicking on search icon while app is loading[/+]strepanier03 commentedon Dec 19, 2024
Payment Summary
strepanier03 commentedon Dec 19, 2024
I'll remove the hold from the payment summary tomorrow.
strepanier03 commentedon Dec 20, 2024
@nkdengineer - I've paid and closed your contract in Upwork, thank you!
@alitoshmatov - The payment summary is here and you're welcome to request payment, thank you as well.
Have a lovely new year!
JmillsExpensify commentedon Dec 30, 2024
$250 approved for @alitoshmatov