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

[HOLD for payment 2023-12-15] IOU - Infinite loading when click on E-Receipt of distance request created offline #32501

Closed
6 tasks done
lanitochka17 opened this issue Dec 5, 2023 · 12 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 5, 2023

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: 1.4.8-0
Reproducible in staging?: Y
Reproducible in production?: N
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:

Issue found when executing PR #32424

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Go offline
  3. Create a distance request
  4. Go to transaction thread report of this request
  5. Click on receipt image

Expected Result:

The EReceipt is displayed

Actual Result:

The EReceipt is not displayed. There is Infinite loading when click on EReceipt
The receipt shows attachment thumbnail on Android and iOS

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

Add any screenshot/video evidence

Bug6302109_1701797499956.Recording__1474.mp4

View all open jobs on GitHub

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Dec 5, 2023
Copy link
Contributor

github-actions bot commented Dec 5, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Dec 5, 2023

Triggered auto assignment to @iwiznia (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@iwiznia
Copy link
Contributor

iwiznia commented Dec 5, 2023

@lanitochka17 if you can, always include a screenshot of the JS console for issues reproducible in web.

@neil-marcellini
Copy link
Contributor

I think this is the offending PR Remove receipt from carousel, and we should revert it since it breaks distance eReceipts, both on and offline.

Copy link

melvin-bot bot commented Dec 5, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Dec 5, 2023

Proposal

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

IOU - Infinite loading when click on E-Receipt of distance request created offline

What is the root cause of that problem?

This is a regression from other PR as mentioned in the above comment.

If we're going to keep the PR up and going, here's my explanation for the issue.

This only happens when we turn on Staging server, which typically happens only on staging or dev environments, so this shouldn't effect the real application at all.

But the the real issue lies in this block of code,

const imageSource = tryResolveUrlFromApiRoot(image || '');
const thumbnailSource = tryResolveUrlFromApiRoot(thumbnail || '');
where we fetch the image based on the host, say if we're using staging or in staging env it appends staging to the route.

But since we're in offline mode, we're loading image (thumbnail) from local source which is served under / public path that's, but if we add /staging to the URL it get's issue.

So here's the main issue, adding /staging for local files i.e serving on public folder.

This only have observed here, but it's potential issue which can anytime cause the issue.

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

We already have the logic to handle the local file rendering for mobile apps, but not for desktop devices.

We need to update tryResolveUrlFromApiRoot this function to accept a new argument telling that if the file is from local or remote source (depending on the state of the network & the onyx data).

function tryResolveUrlFromApiRoot(url: string, isLocalFile?: boolean): string;
function tryResolveUrlFromApiRoot(url: number, isLocalFile?: boolean): number;
function tryResolveUrlFromApiRoot(url: string | number, isLocalFile?: boolean): string | number {
    // in native, when we import an image asset, it will have a number representation which can be used in `source` of Image
    // in this case we can skip the url resolving
    if (typeof url === 'number' || isLocalFile) {
        return url;
    }
    const apiRoot = ApiUtils.getApiRoot({ shouldUseSecure: false } as Request);
    return url.replace(ORIGIN_PATTERN, apiRoot);
}

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 5, 2023
Copy link

melvin-bot bot commented Dec 5, 2023

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production labels Dec 8, 2023
@melvin-bot melvin-bot bot changed the title IOU - Infinite loading when click on E-Receipt of distance request created offline [HOLD for payment 2023-12-15] IOU - Infinite loading when click on E-Receipt of distance request created offline Dec 8, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Dec 8, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.9-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-12-15. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 14, 2023
Copy link

melvin-bot bot commented Dec 15, 2023

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

Copy link

melvin-bot bot commented Dec 18, 2023

@neil-marcellini Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@neil-marcellini
Copy link
Contributor

We just reverted a PR here, so the resolution is being handled in the original issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

5 participants