Skip to content

[HOLD for payment 2024-01-17] Distance - 404 error appears in console after creating distance request #33985

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.22-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:

Action Performed:

  1. Go to workspace chat
  2. Click + > Request money > Distance
  3. Create a distance request

Expected Result:

There will be no console error after creating distance request

Actual Result:

404 error shows up after creating distance 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

Add any screenshot/video evidence

Bug6332605_1704406861120.20240105_054211.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCash
    on Jan 4, 2024
  2. github-actions commented on Jan 4, 2024

    @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.
  3. melvin-bot commented on Jan 4, 2024

    @melvin-bot

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

  4. thienlnam commented on Jan 4, 2024

    @thienlnam
    Contributor

    I tested it myself and it also appears to try to fetch the same URL

  5. thienlnam commented on Jan 4, 2024

    @thienlnam
    Contributor

    It's not causing any issues - but it kind of looks similar to an issue pointed back here #30319

  6. thienlnam commented on Jan 5, 2024

    @thienlnam
    Contributor

    Okay, looks like that URL is for the optimistic receipt - the generic receipt image
    import ReceiptGeneric from '@assets/images/receipt-generic.png';

    Going to see where this is hosted

  7. bernhardoj commented on Jan 5, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The receipt image can't be found for distance requests.

    What is the root cause of that problem?

    When we create a new distance request, we set a local asset image as the optimistic receipt image.

    App/src/libs/actions/IOU.js

    Lines 870 to 873 in 2d455bf

    const optimisticReceipt = {
    source: ReceiptGeneric,
    state: CONST.IOU.RECEIPT_STATE.OPEN,
    };

    And the isLocalFile condition here doesn't consider the case of the web local asset.

    const isLocalFile = typeof path === 'number' || path.startsWith('blob:') || path.startsWith('file:');
    return {thumbnail: image, image: path, isLocalFile};

    So, isLocalFile is always false.

    If isLocalFile is false, we will try to load the image as if it's a remote image.

    } else if (thumbnail && !isLocalFile && !Str.isPDF(imageSource)) {
    receiptImageComponent = (
    <ThumbnailImage
    previewSourceURL={thumbnailSource}
    style={[styles.w100, styles.h100]}
    isAuthTokenRequired
    shouldDynamicallyResize={false}
    />
    );
    } else {

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

    Add a new condition to isLocalFile to check for the local file.

    const isLocalFile = ... || path === ReceiptGeneric;
    
  8. situchan commented on Jan 5, 2024

    @situchan
    Contributor

    This is another regression from #33946
    cc: @namhihi237

  9. namhihi237 commented on Jan 5, 2024

    @namhihi237
    Contributor

    I can not reproduce it on a local, anyone can reproduce it.

  10. namhihi237 commented on Jan 5, 2024

    @namhihi237
    Contributor

    Seem this issue only reproduce on the remote server.

  11. namhihi237 commented on Jan 5, 2024

    @namhihi237
    Contributor

    Do we use right the domain host for the image staging.expensify.com? when I update to staging.new.expensify.com, it works

  12. added
    Reviewing
    Weekly
    and removed
    Hourly
    on Jan 5, 2024
  13. mvtglobally commented on Jan 7, 2024

    @mvtglobally

    Still repro on build 1.4.22-2

    bandicam.2024-01-06.14-20-41-599.mp4
  14. thienlnam commented on Jan 8, 2024

    @thienlnam
    Contributor

    We're handling this regression in this PR #34030

  15. thienlnam commented on Jan 8, 2024

    @thienlnam
    Contributor

    Verified this is fixed on staging now

  16. added
    Weekly
    Awaiting Payment
    and removed
    Weekly
    on Jan 10, 2024
  17. changed the title [-]Distance - 404 error appears in console after creating distance request[/-] [+][HOLD for payment 2024-01-17] Distance - 404 error appears in console after creating distance request[/+] on Jan 10, 2024
  18. removed
    Reviewing
    on Jan 10, 2024
  19. melvin-bot commented on Jan 10, 2024

    @melvin-bot

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

  20. melvin-bot commented on Jan 10, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.23-4 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 2024-01-17. 🎊

  21. removed
    DeployBlockerCash
    on Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Awaiting PaymentEngineeringWeekly

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions