-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2024-09-03] [$250] Distance - Error displayed when creating distance expense in workspace that not opened yet #45856
Comments
Triggered auto assignment to @puneetlath ( |
@puneetlath FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
We think that this bug might be related to #wave-collect - Release 1 |
Edited by proposal-police: This proposal was edited at 2024-08-07 16:44:06 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Distance - Error displayed when creating distance expense in workspace that not opened yet What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?We should update the condition to remove useEffect(() => {
if (customUnitRateID && customUnitRateID !== '-1') {
return;
}
const rateID = lastSelectedDistanceRates?.[policy?.id ?? ''] ?? defaultMileageRate?.customUnitRateID ?? '';
IOU.setCustomUnitRateID(transactionID, rateID);
}, [defaultMileageRate, customUnitRateID, lastSelectedDistanceRates, policy?.id, canUseP2PDistanceRequests, transactionID]); We can also consider not updating the What alternative solutions did you explore? (Optional)
useEffect(() => {
if (customUnitRateID && customUnitRateID !== '-1') {
return;
}
const defaultRate = defaultMileageRate?.customUnitRateID ?? '';
const rateID = canUseP2PDistanceRequests ? lastSelectedDistanceRates?.[policy?.id ?? ''] ?? defaultRate : defaultRate;
IOU.setCustomUnitRateID(transactionID, rateID );
}, [defaultMileageRate, customUnitRateID, lastSelectedDistanceRates, policy?.id, canUseP2PDistanceRequests, transactionID]);
/**
* Returns custom unit rate ID for the distance transaction
*/
function getCustomUnitRateID(reportID: string, shouldUseDefault?: boolean) {
const allReports = ReportConnection.getAllReports();
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`];
const policy = PolicyUtils.getPolicy(report?.policyID ?? parentReport?.policyID ?? '-1');
let customUnitRateID: string = CONST.CUSTOM_UNITS.FAKE_P2P_ID;
if (ReportUtils.isPolicyExpenseChat(report) || ReportUtils.isPolicyExpenseChat(parentReport)) {
const distanceUnit = Object.values(policy?.customUnits ?? {}).find((unit) => unit.name === CONST.CUSTOM_UNITS.NAME_DISTANCE);
const lastSelectedDistanceRateID = lastSelectedDistanceRates?.[policy?.id ?? '-1'] ?? '-1';
const lastSelectedDistanceRate = distanceUnit?.rates[lastSelectedDistanceRateID] ?? {};
if (lastSelectedDistanceRate.enabled && lastSelectedDistanceRateID && !shouldUseDefault) {
customUnitRateID = lastSelectedDistanceRateID;
} else {
customUnitRateID = getDefaultMileageRate(policy)?.customUnitRateID ?? '-1';
}
}
return customUnitRateID;
}
const rateID = DistanceRequestUtils.getCustomUnitRateID(firstParticipantReportID, !canUseP2PDistanceRequests); |
@puneetlath Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~010cab8213f1b00e98 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @allgandalf ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.The error "The selected rate has been deletedUnexpected error submitting this expense. Please try again later." is displayed What is the root cause of that problem?We have logic to update the App/src/components/MoneyRequestConfirmationList.tsx Lines 229 to 237 in b0f810d
but that useEffect is working incorrectly. In case What changes do you think we should make in order to solve the problem?We should update the useEffect to:
In above:
does not cover. For example, the P2P case, lastSelectedDistanceRate is disabled, ... and it is used in other position:
|
I am waiting to review the proposals based on this thread #38543 (comment), interesting discussion going on. Will tell of the next steps once that discussion leads somewhere |
@puneetlath, @allgandalf Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@puneetlath @allgandalf 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! |
Still no update on that PR discussion, i will bump neil on open source channel on monday |
bumped them on open source channel |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Proposal Updated
|
Sorry, was stuck with something super urgent internally 🔥 (slack for reference), I will review the proposals today |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@allgandalf have you had a chance to review? |
sorry, this was weekly so didn't see it in K2 😅 , I will review proposals today EOD |
From the conversation we had, and from what @neil-marcellini suggested here, we should go with @Krishna2323's alternative solution here, their RCA is correct and alternate solution would work based on the results we expect for this bug. 🎀👀🎀 C+ reviewed |
Current assignee @puneetlath is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
📣 @allgandalf 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @Krishna2323 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
@allgandalf, PR ready for review ^ |
I approve the PR, all yours @puneetlath 🙇 |
PR got into production today |
@allgandalf can you complete the checklist? |
Sure thing ! |
Regression Test Proposal
Do we agree 👍 or 👎 |
This should be ready for payment on 3rd |
This is ready for payment @puneetlath 🙇 |
Regression test: https://github.com/Expensify/Expensify/issues/425941 All paid. Thanks everyone! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.10-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Issue found when executing PR #45000
Action Performed:
and log in with an existing account than has a workspace (make sure to open any chat other that workspace chat when logging out)
Expected Result:
The distance expense is created
Actual Result:
The error "The selected rate has been deletedUnexpected error submitting this expense. Please try again later." is displayed
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6548285_1721499025434.Recording__622.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @allgandalfThe text was updated successfully, but these errors were encountered: