-
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] Track expense - Error submitting expense when workspace has disabled all workflow features #57002
Comments
Triggered auto assignment to @sakluger ( |
Job added to Upwork: https://www.upwork.com/jobs/~021891887287630155892 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
🚨 Edited by proposal-police: This proposal was edited at 2025-02-21 03:58:57 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Track expense - Error submitting expense when workspace has disabled all workflow features What is the root cause of that problem?When we What changes do you think we should make in order to solve the problem?In case the action is share and the workspace does not have App/src/libs/OptionsListUtils.ts Lines 1439 to 1441 in 14c5b21
if (shouldSeparateWorkspaceChat && newReportOption.isOwnPolicyExpenseChat && !newReportOption.private_isArchived) {
if (!(action === CONST.IOU.ACTION.SHARE && !arePaymentsEnabled(getPolicy(newReportOption.policyID)))) {
workspaceChats.push(newReportOption);
}
} We can do the same with the case workspace is displayed in Screen.Recording.2025-02-21.at.12.55.37.movWhat specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?NA What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Error submitting expense when workspace has disabled all workflow features What is the root cause of that problem?When we disable all features of the workflow and share a tracked expense to that workspace, the backend responds with a 401 error, which is then displayed. However, if at least one of the three features is enabled, the issue does not occur. ![]() What changes do you think we should make in order to solve the problem?To resolve this issue, we need to show a modal informing the user that they are unable to share to their account if the workflow feature is not enabled. Here is step to implement it: 1 Create new state to show/hide modal const [isUnableToShareToAccount, setIsUnableToShareToAccount] = useState(false);
<ConfirmModal
title={'Unable to Share Expense'}
isVisible={isUnableToShareToAccount}
onConfirm={() => {
setIsUnableToShareToAccount(false);
Navigation.goBack();
}}
prompt={'This expense cannot be shared because the "Make or Track Payments" workflow is not enabled in your workspace settings.'}
confirmText={'Got it'}
shouldShowCancelButton={false}
danger
/>
add here: if (action === CONST.IOU.ACTION.SHARE) {
if (
!(
policy?.areWorkflowsEnabled &&
(policy.approvalMode !== CONST.POLICY.APPROVAL_MODE.OPTIONAL ||
policy.autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.INSTANT ||
policy?.reimbursementChoice !== CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO)
)
) {
setIsUnableToShareToAccount(true);
return;
}
}
We need to confirm the behavior with @Expensify/design. We can either disable the button, show a message, or navigate to the workflow page after clicking the 'Got it' button. Test branchScreen.Recording.2025-02-19.at.15.46.14.mp4What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?None What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
@sakluger Can we make clear what is the expected result here. Technically the error is correct since workspace has disabled "Make or track payments" thus you cannot share your tracked expanse from self chat to this workspace. I think the issue is how should we handle this situation. |
@Themoonalsofall Can you write more details on your proposal, I am not sure what you meant there |
@alitoshmatov I'm asking for clarification on expected behavior from my team (here's the Slack post) @IuliiaHerets I noticed that the tester's account in the video is different from the account listed on the GH issue. I had been trying to search for logs using the email posted on the GH issue, and couldn't find anything - I would have saved a lot of time if the correct email had been added. Could you please make sure to use the correct tester email on each issue? Thanks! |
@alitoshmatov I have updated my proposal with more details and added results. |
After talking with the team, it looks like this is a super edge case issue that probably wouldn't ever happen for a real-world customer. Closing out 👍 |
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.1.0.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Device used: Mac 15.0 / Chrome
App Component: Money Requests
Action Performed:
Expected Result:
The expense will be submitted to the workspace chat without issue.
Actual Result:
App throws error after submitting the expense to the workspace chat.
It shows "Unexpected error submitting this expense. Please try again later."
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6746480_1739869275602.20250218_165217.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alitoshmatovThe text was updated successfully, but these errors were encountered: