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
[$250] [HOLD for payment 2024-06-13] HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList #42384
e.g. memory consumption, storage read/write times, React native bridge concerns, inefficient React component rendering, etc.
Currently, when you use search in New Expensify, we show results progressively and put the "best result" at the top. However a query for the full optionList always finishes after you've started it, even if you navigate away from the page that is performing the command.
What is the impact of this on end-users?
List specific user experiences that will be improved by solving this problem e.g. app boot time, time to for some interaction to complete, etc.
When you have navigated to the page you actually want, that page is a little slow because there is an expensive operation still running in the background.
List any benchmarks that show the severity of the issue
Please also provide exact steps taken to collect metrics above if any so we can independently verify the results.
Proposed solution (if any)
Please list out the steps you think we should take to solve this issue.
Create a new "cancel" API command that ceases the operation of querying search when you navigate to the report you've selected from the optionList.
List any benchmarks after implementing the changes to show impacts of the proposed solution (if any)
Note: These should be the same as the benchmarks collected before any changes.
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
Version Number: Reproducible in staging?: Reproducible in production?: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation Expensify/Expensify Issue URL: Issue reported by: Slack conversation:
Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.
changed the title [-]HIGH: [API Reliability] Add cancel API command function when you select an option in search[/-][+]HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/+]on May 20, 2024
@muttmuure I won't be available in the next few days, sharing my findings from today. I'm looping in the Callstack team to take over in our morning :)
Research
Each API.read command like searchForReports can be manually aborted when having a canCancel data parameter, but this relies on a single AbortController instance for all the requests. We could manually trigger cancellation here this way:
const selectReport = (option: OptionData) => {
console.log('Navigating to a report', option);
if (!option) {
return;
}
+ HttpUtils.cancelPendingRequests();
if (option.reportID) {
setSearchValue('');
Navigation.dismissModal(option.reportID);
} else {
Report.navigateToAndOpenReport(option.login ? [option.login] : []);
}
};
...but it'd cancel everything that is currently running, potentially not only our Search queries (which we have multiple when typing even slightly slower).
Options
Test the above solution on a build, it may be that it's totally safe to run a regular full cancellation there.
Add per-query cancellation, which will require using a separate abort controller for this API command we can call .abort() on when selecting a report.
changed the title [-][HOLD for payment 2024-06-13] HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/-][+][$250] [HOLD for payment 2024-06-13] HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/+]on Jun 14, 2024
Activity
melvin-bot commentedon May 20, 2024
Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext.
adhorodyski commentedon May 20, 2024
Isn't the need more on cancelling the frontend request, like with an https://developer.mozilla.org/en-US/docs/Web/API/AbortController?
muttmuure commentedon May 20, 2024
Ah, yeah probably. Apologies as I didn't fully understand this one, you might be right
[-]HIGH: [API Reliability] Add cancel API command function when you select an option in search[/-][+]HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/+]muttmuure commentedon May 20, 2024
Would you be interested in taking it on?
adhorodyski commentedon May 20, 2024
sure, let's do it - you can assign this to me
adhorodyski commentedon May 21, 2024
@muttmuure I won't be available in the next few days, sharing my findings from today. I'm looping in the Callstack team to take over in our morning :)
Research
Each
API.readcommand like searchForReports can be manually aborted when having acanCanceldata parameter, but this relies on a single AbortController instance for all the requests. We could manually trigger cancellation here this way:const selectReport = (option: OptionData) => { console.log('Navigating to a report', option); if (!option) { return; } + HttpUtils.cancelPendingRequests(); if (option.reportID) { setSearchValue(''); Navigation.dismissModal(option.reportID); } else { Report.navigateToAndOpenReport(option.login ? [option.login] : []); } };...but it'd cancel everything that is currently running, potentially not only our Search queries (which we have multiple when typing even slightly slower).
Options
.abort()on when selecting a report.rinej commentedon May 22, 2024
@muttmuure hello I am Tomek from Callstack, I will take it over from Adam
muttmuure commentedon May 22, 2024
Thanks!
18 remaining items
[-][HOLD for payment 2024-06-13] HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/-][+][$250] [HOLD for payment 2024-06-13] HIGH: [API Reliability] Add cancel function when you select an option in search and navigate away from the optionList[/+]melvin-bot commentedon Jun 14, 2024
Job added to Upwork: https://www.upwork.com/jobs/~0164d3f1e9ba4d7d59
melvin-bot commentedon Jun 14, 2024
Current assignee @shubham1206agra is eligible for the External assigner, not assigning anyone new.
mountiny commentedon Jun 14, 2024
$250 to @shubham1206agra for their review
melvin-bot commentedon Jun 18, 2024
@rinej, @mountiny, @adhorodyski, @VictoriaExpensify, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
kadiealexander commentedon Jun 19, 2024
@shubham1206agra I have sent you an Upwork contract on behalf of @VictoriaExpensify, could you please let us know here when it's been accepted and we'll issue payment? Thanks!
shubham1206agra commentedon Jun 19, 2024
@kadiealexander Accepted
VictoriaExpensify commentedon Jun 19, 2024
Thanks @shubham1206agra ! I'm just having a few Upwork issues but I'll get this sorted and get you paid ASAP
kadiealexander commentedon Jun 19, 2024
I've paid out @shubham1206agra while Vic sorts her access.