Skip to content

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

Closed

Description

@lanitochka17

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

Activity

  1. github-actions commented on Dec 5, 2023

    @github-actions
    Contributor

    👋 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.
  2. melvin-bot commented on Dec 5, 2023

    @melvin-bot

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

  3. iwiznia commented on Dec 5, 2023

    @iwiznia
    Contributor

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

  4. neil-marcellini commented on Dec 5, 2023

    @neil-marcellini
    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.

  5. melvin-bot commented on Dec 5, 2023

    @melvin-bot

    ⚠️ 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.

  6. b4s36t4 commented on Dec 5, 2023

    @b4s36t4
    Contributor

    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

  7. 8 remaining items

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Dec 8, 2023
  9. 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[/+] on Dec 8, 2023
  10. melvin-bot commented on Dec 8, 2023

    @melvin-bot

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

  11. melvin-bot commented on Dec 8, 2023

    @melvin-bot

    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
  12. melvin-bot commented on Dec 15, 2023

    @melvin-bot

    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.

  13. melvin-bot commented on Dec 18, 2023

    @melvin-bot

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

  14. neil-marcellini commented on Dec 18, 2023

    @neil-marcellini
    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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions