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
[HOLD for payment 2024-02-14] [$500] Long pressing "Go to Expensify Classic" option in Settings Crashes the App #35310
changed the title [-]Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/-][+][$500] Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/+]on Jan 29, 2024
Users are experiencing app crashes when performing a long press on the "Go to Expensify Classic" option in Settings.
Root Cause
We are not using Link.buildOldDotURL properly in the getDefaultMenuItems in the InitialSettingsPage. The function returns a promise instead of a string, leading to unexpected behavior and crash.
// src/pages/settings/InitialSettingsPage.jsconstonSecondaryInteraction=(link,event)=>{if(typeoflink==='function'){console.debug('InitialSettingsPage: secondaryInteraction: link is a function, executing it');link().then((url)=>ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK,event,url,popoverAnchor.current));}elseif(link){ReportActionContextMenu.showContextMenu(CONST.CONTEXT_MENU_TYPES.LINK,event,link,popoverAnchor.current);}};<MenuItem// rest of propsonSecondaryInteraction={item.link!==undefined ? (e)=>onSecondaryInteraction(item.link,e) : undefined}/>
Please re-state the problem that we are trying to solve in this issue.
Secondary action for button "Go to Expensify Classic" in Settings Crashes the App
What is the root cause of that problem?
We are using buildOldDotURL method as secondary action, but this return an promise-string and we are expecting just a string, this cause that our ReportActionContextMenu.showContextMenu rise the error.
What changes do you think we should make in order to solve the problem?
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@mananjadhav / @ishpaul777] The PR that introduced the bug has been identified. Link to the PR:
[@mananjadhav / @ishpaul777] 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:
[@mananjadhav / @ishpaul777] A discussion in #expensify-bugs 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:
[@mananjadhav / @ishpaul777] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
I tried finding the root PR, the best one where we refactored the links in InitialSettingsPage is this PR. @ishpaul777 if you could identify the offending PR?
I don't think we need a regression test for this one.
@mananjadhav $500 - please request via ND @ishpaul777 Contributor - $500 paid ✔️ (not sure why melvin decided there should be two offers. In fact looks like it might have duplicated by accident)
A discussion in #expensify-bugs 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: not required
Determine if we should create a regression test for this bug. not required
If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. - not required
Activity
melvin-bot commentedon Jan 29, 2024
Triggered auto assignment to @sonialiap (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jan 29, 2024
Job added to Upwork: https://www.upwork.com/jobs/~017b2c107d082607ce
[-]Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/-][+][$500] Long pressing "Go to Expensify Classic" option in Settings Crashes the App[/+]melvin-bot commentedon Jan 29, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)ishpaul777 commentedon Jan 29, 2024
Proposal
Problem Statement
Users are experiencing app crashes when performing a long press on the "Go to Expensify Classic" option in Settings.
Root Cause
We are not using
Link.buildOldDotURLproperly in thegetDefaultMenuItemsin theInitialSettingsPage. The function returns a promise instead of a string, leading to unexpected behavior and crash.App/src/pages/settings/InitialSettingsPage.js
Line 274 in c5ca9a8
Proposed Solution
To address the problem, we should handle the link properly similar to what we have done for MenuItemList:
App/src/pages/settings/InitialSettingsPage.js
Line 274 in c5ca9a8
to:
App/src/components/MenuItemList.tsx
Lines 34 to 40 in c5ca9a8
samilabud commentedon Jan 29, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Secondary action for button "Go to Expensify Classic" in Settings Crashes the App
What is the root cause of that problem?
We are using buildOldDotURL method as secondary action, but this return an promise-string and we are expecting just a string, this cause that our ReportActionContextMenu.showContextMenu rise the error.
What changes do you think we should make in order to solve the problem?
We should make the same as our main action and call the openOldDotLink method.
Something like:
Result:
long.pressing.crashes.the.app.test.mp4
mananjadhav commentedon Jan 30, 2024
@ishpaul777's proposal looks good.
🎀 👀 🎀 C+ reviewed.
melvin-bot commentedon Jan 30, 2024
Triggered auto assignment to @nkuoch, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
17 remaining items
melvin-bot commentedon Feb 7, 2024
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
mananjadhav commentedon Feb 12, 2024
I tried finding the root PR, the best one where we refactored the links in
InitialSettingsPageis this PR. @ishpaul777 if you could identify the offending PR?I don't think we need a regression test for this one.
sonialiap commentedon Feb 14, 2024
@mananjadhav $500 - please request via ND
@ishpaul777 Contributor - $500 paid ✔️ (not sure why melvin decided there should be two offers. In fact looks like it might have duplicated by accident)
JmillsExpensify commentedon Feb 14, 2024
$500 approved for @mananjadhav based on summary above.
ishpaul777 commentedon Feb 14, 2024
could be because i reported the bug also, maybe there is still bug report bounty automation in place for these messages?
ishpaul777 commentedon Feb 14, 2024
sorry missed this earlier, will look into this
ishpaul777 commentedon Feb 16, 2024
This PR https://github.com/Expensify/App/pull/32947/files added a new menu item in settings page and this one is the offending PR #33863 to be specific
sonialiap commentedon Feb 16, 2024
@mananjadhav @ishpaul777 could you please complete the checklist :)
ishpaul777 commentedon Feb 16, 2024
ishpaul777 commentedon Feb 19, 2024
not overdue, we can close this now