Skip to content
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

[$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. #33750

Closed
1 of 6 tasks
izarutskaya opened this issue Dec 29, 2023 · 30 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Dec 29, 2023

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: 1.4.19-0
Reproducible in staging?: Y
Reproducible in production?: Y
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: Applause-Internal Team
Slack conversation: @

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Log in with any account.
  3. Create a Scan Request in the 1:1 DM using a camera
  4. Open IOU

Expected Result:

IOU opens

Actual Result:

“Hmm.. it’s not here” appears when open existing scanning request.

Workaround:

Unknown

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

Screenshots/Videos

Bug6328193_1703835354378.Scan.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ae77eeffa1097865
  • Upwork Job ID: 1740696913839783936
  • Last Price Increase: 2023-12-29
Issue OwnerCurrent Issue Owner: @laurenreidexpensify
@izarutskaya izarutskaya added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 29, 2023
@melvin-bot melvin-bot bot changed the title Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. [$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. Dec 29, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01ae77eeffa1097865

Copy link

melvin-bot bot commented Dec 29, 2023

Triggered auto assignment to @laurenreidexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 29, 2023
Copy link

melvin-bot bot commented Dec 29, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

Copy link

melvin-bot bot commented Dec 29, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

@bernhardoj
Copy link
Contributor

bernhardoj commented Dec 29, 2023

Proposal

Please re-state the problem that we are trying to solve in this issue.

Chat not found page shows when we open the ongoing scan request. This can happen on a manual request too.

What is the root cause of that problem?

When we do a new money request and then press the request preview before the money request API completes, we will optimistically create a new transaction thread.

// If the childReportID is not present, we need to create a new thread
const childReportID = lodashGet(action, 'childReportID', 0);
if (!childReportID) {
const thread = ReportUtils.buildTransactionThread(action, requestReportID);
const userLogins = PersonalDetailsUtils.getLoginsByAccountIDs(thread.participantAccountIDs);
Report.openReport(thread.reportID, userLogins, thread, action.reportActionID);
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(thread.reportID));
return;
}
Report.openReport(childReportID);
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(childReportID));

So, now the API request queue looks like this:
[RequestMoney, OpenReport]

If we optimistically create a new thread, it will set childReportID optimistically, but it will set the childReportID to 0 if fails.

// If we are creating a thread, ensure the report action has childReportID property added
if (newReportObject.parentReportID && parentReportActionID) {
optimisticData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: reportID, childType: CONST.REPORT.TYPE.CHAT}},
});
failureData.push({
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${newReportObject.parentReportID}`,
value: {[parentReportActionID]: {childReportID: '0', childType: ''}},
});
}

Currently, from what I see, creating an optimistic transaction thread will always fail.

From the log below, you can see that after the RequestMoney API completes, it will return a new childReportID, but different from the optimistic childReportID.
image

But because the optimistic thread fails, the childReportID becomes "0".
image

If you go back to the parent report, the OpenReport will be requested again for the parent report and it will return the correct childReportID, but if you press the request preview again before the OpenReport completes, it will open a report with a report ID of 0. That's why we see the not found page.

What changes do you think we should make in order to solve the problem?

Don't reset the childReportID to "0" (and childType) when the open report fails, only for money request transaction thread case.

(I think technically we should reset childReportID to null/empty string)

What alternative solutions did you explore? (Optional)

Fix the issue on the BE why the optimistic transaction thread always fail

@shubham1206agra
Copy link
Contributor

@bernhardoj Can you tell me why this problem only occurs on Android? Or is this problem occurs on other platforms?

@bernhardoj
Copy link
Contributor

@shubham1206agra it occurs on all platforms. I debug it on the web.

@shubham1206agra
Copy link
Contributor

Lets take this internal.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jan 3, 2024

Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@shubham1206agra
Copy link
Contributor

@AndrewGable Can you take this internal to see why all request have different childReportID than optimistic one?

@laurenreidexpensify laurenreidexpensify added the Internal Requires API changes or must be handled by Expensify staff label Jan 3, 2024
Copy link

melvin-bot bot commented Jan 3, 2024

Current assignee @shubham1206agra is eligible for the Internal assigner, not assigning anyone new.

@AndrewGable AndrewGable removed External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 4, 2024
@melvin-bot melvin-bot bot added the Overdue label Jan 5, 2024
Copy link

melvin-bot bot commented Jan 8, 2024

@AndrewGable, @shubham1206agra, @laurenreidexpensify Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Jan 10, 2024

@AndrewGable, @shubham1206agra, @laurenreidexpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@tgolen
Copy link
Contributor

tgolen commented Jan 12, 2024

@AndrewGable with my brief local testing, I see this error in the logs:

403 Cannot create child report linked to an existing parent report action

Which is thrown from here: https://github.com/Expensify/Auth/blob/36a159afd4e319c3dc09a464089b5f973c80d878/auth/command/OpenReport.cpp#L218

The error happens because of the parentReportActionID that is sent in the request for OpenReport, but I don't really understand what the purpose of that error is. @chiragsalian you added that error in https://github.com/Expensify/Auth/pull/7834, is there any guidance or context you can give us about this error or what we should do to prevent it from happening?

Looking at server logs, this error happens BUNCHES:
image

@tgolen
Copy link
Contributor

tgolen commented Jan 12, 2024

NM Chirag is on extended leave right now, so we gotta try to figure this out on our own.

@laurenreidexpensify laurenreidexpensify changed the title [$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. Hold on #33114 [$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. Jan 15, 2024
@laurenreidexpensify
Copy link
Contributor

Not overdue - changing track to see if #33114 solves this

@melvin-bot melvin-bot bot removed the Overdue label Jan 15, 2024
@laurenreidexpensify laurenreidexpensify added Monthly KSv2 and removed Weekly KSv2 labels Jan 22, 2024
@laurenreidexpensify
Copy link
Contributor

Downgrading as #33114 is monthly

@laurenreidexpensify
Copy link
Contributor

hold on #33114 which is currently on hold too 🙃

@laurenreidexpensify laurenreidexpensify added Daily KSv2 retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause and removed Monthly KSv2 labels Mar 21, 2024
@melvin-bot melvin-bot bot added the Overdue label Mar 21, 2024
@laurenreidexpensify
Copy link
Contributor

#33114 is now on prod, so let's get this retested and confirm if it it's been resolved, so we can close

@melvin-bot melvin-bot bot removed the Overdue label Mar 21, 2024
@laurenreidexpensify laurenreidexpensify changed the title Hold on #33114 [$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. [$500] Android - IOU – “Hmm.. it’s not here” appears when open existing scanning request. Mar 21, 2024
@melvin-bot melvin-bot bot added the Overdue label Mar 25, 2024
@laurenreidexpensify
Copy link
Contributor

Waiting for retesting, actually this can be a weekly

@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@melvin-bot melvin-bot bot removed the Overdue label Mar 25, 2024
@shubham1206agra
Copy link
Contributor

@laurenreidexpensify Can you get this retested?

@mvtglobally
Copy link

QA team is not able to confirm if this issue is still reproducible during KI retests as issue is Blocked to test by #27691.

@AndrewGable
Copy link
Contributor

You can't test on a different Android device? I thought that issue was only a small amount of devices

@laurenreidexpensify
Copy link
Contributor

@shubham1206agra pls confirm thank you

@shubham1206agra
Copy link
Contributor

@laurenreidexpensify I am unable to repro this issue.
Asked in slack if someone can repro https://expensify.slack.com/archives/C02NK2DQWUX/p1712061207676789.

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@shubham1206agra
Copy link
Contributor

@laurenreidexpensify We can close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Internal Requires API changes or must be handled by Expensify staff retest-weekly Apply this label if you want this issue tested on a Weekly basis by Applause Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants