-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] 'Recents' contacts when submitting expense does not update #48608
Comments
Triggered auto assignment to @twisterdotcom ( |
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
@flodnv are these steps right?
Does it have to be 3 expenses over 3 days? |
No, maybe it's just 1. I used 3 in my example to point out that it's obvious it should be there. |
This comment was marked as outdated.
This comment was marked as outdated.
Put an iOS vid above, but doing a web one now for commentary, this is a real bug that I think is recreatable just by:
We should absolutely during the "Submit expense" flow especially be prioritising places you have submitted expenses before and Workspace chats overall, over ALL normal chats where no expenses have been shared whatsoever. 48608.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~021833488575321005184 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
@twisterdotcom, @Ollyws Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Asking for some proposals here: https://expensify.slack.com/archives/C01GTK53T8Q/p1726487090872509 |
Edited by proposal-police: This proposal was edited at 2024-09-17 03:13:38 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Recent reports do not show the workspace chat even though an expense was submitted to it recently. What is the root cause of that problem?We give the highest priority only to the active policy here in ordering App/src/libs/OptionsListUtils.ts Lines 1576 to 1583 in 4b41dd1
For all other policies, even though there were some expenses recently submitted to them they were given a lower priority than DMs here App/src/libs/OptionsListUtils.ts Lines 1594 to 1599 in 4b41dd1
So, only the user's active policy is at the top but after that DMs with others are prioritized over non-active policies. What changes do you think we should make in order to solve the problem?Based on this comment by @twisterdotcom
I think the order should be like this for
To achieve this order, we can add a field if (!!action) {
const iouReportID = reportOption.iouReportID;
if (iouReportID) {
const iouReportActions = allSortedReportActions[iouReportID] ?? [];
const lastIOUAction = iouReportActions.find((iouAction) => iouAction.actionName === "IOU");
if (lastIOUAction) {
reportOption.lastMoneyRequestTime = lastIOUAction.lastModified;
}
} here App/src/libs/OptionsListUtils.ts Line 1983 in 2af5a95 and we can pass a parameter to orderOptions such as preferRecentExpenseReports here
App/src/libs/OptionsListUtils.ts Line 2032 in 2af5a95
like this recentReportOptions = orderOptions(recentReportOptions, searchValue, {preferChatroomsOverThreads: true, preferPolicyExpenseChat: !!action, preferRecentExpenseReports: !!action}); and the sorting in function orderOptions(options: ReportUtils.OptionData[], searchValue: string | undefined, {preferChatroomsOverThreads = false, preferPolicyExpenseChat = false, preferRecentExpenseReports = false} = {}) {
return lodashOrderBy(
options,
[
(option) => {
if (option.isPolicyExpenseChat && preferPolicyExpenseChat && option.policyID === activePolicyID) {
return 0;
}
if (option.isSelfDM) {
return 0;
}
if (preferRecentExpenseReports && !!option?.lastMoneyRequestTime) {
return 1;
// We can have a bit different logic like this then we do not need two `desc` `desc` breakers. We can just check for `policyExpenseChat` with just on `desc` tie breaker
// We are reducing the `lastMoneyRequestTime` to a number between 0 and 1 with min and max times as -+1 years
// const oneYearInMs = 365 * 24 * 60 * 60 * 1000; // Approximate milliseconds in one year
// const today = new Date();
// const minTime = new Date(today).getTime() - oneYearInMs;
// const maxTime = new Date(today).getTime() + oneYearInMs;
// const lastMoneyRequestTimestamp = (new Date(option.lastMoneyRequestTime).getTime() - minTime)/(maxTime - minTime);
// return 1 - lastMoneyRequestTimestamp;
}
if (preferRecentExpenseReports && option.isPolicyExpenseChat) {
return 1;
}
if (preferChatroomsOverThreads && option.isThread) {
return 4;
}
if (!!option.isChatRoom || option.isArchivedRoom) {
return 3;
}
if (!option.login) {
return 2;
}
if (option.login.toLowerCase() !== searchValue?.toLowerCase()) {
return 1;
}
// When option.login is an exact match with the search value, returning 0 puts it at the top of the option list
return 0;
},
preferRecentExpenseReports ? (option) => new Date(option?.lastMoneyRequestTime ?? '1970-01-01').getTime() : 0,
preferRecentExpenseReports ? (option) => option?.isPolicyExpenseChat : 0,
],
['asc', 'desc', 'desc'],
);
} We can similarly pass the const newOptions = OptionsListUtils.filterOptions(defaultOptions, debouncedSearchTerm, {
// other params
preferPolicyExpenseChat: isPaidGroupPolicy,
action,
}); and use that What alternative solutions did you explore? (Optional) |
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@twisterdotcom @Ollyws @MariaHCD this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
The order that @c3024 suggests sounds good to me:
Does this sound good to you, @twisterdotcom ? |
Yeah, this seems logical. I see an argument for switching 2 and 3, but on balance I agree prioritising places you have submitted expenses before is better. |
📣 @c3024 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
PR was deployed to production on 1-Oct. Payment is due today! cc: @twisterdotcom |
Requested in ND. |
$250 approved for @Ollyws |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: n/a
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
Expensify/Expensify Issue URL:
Issue reported by: @flodnv
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1724228186903849
Action Performed:
Expected Result:
The workspace where I always submit to should be in 'Recents' when using it every day
Actual Result:
I don't see the workspace in 'Recents', I have to type it out every day
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @OllywsThe text was updated successfully, but these errors were encountered: