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 2024-01-17] Distance - 404 error appears in console after creating distance request #33985

Closed
2 of 6 tasks
lanitochka17 opened this issue Jan 4, 2024 · 16 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production DeployBlockerCash This issue or pull request should block deployment Engineering Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 4, 2024

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

@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Jan 4, 2024
Copy link
Contributor

github-actions bot commented Jan 4, 2024

👋 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 Jan 4, 2024

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

@thienlnam
Copy link
Contributor

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

@thienlnam
Copy link
Contributor

@thienlnam
Copy link
Contributor

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

@thienlnam
Copy link
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

@bernhardoj
Copy link
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;

@situchan
Copy link
Contributor

situchan commented Jan 5, 2024

This is another regression from #33946
cc: @namhihi237

@namhihi237
Copy link
Contributor

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

@namhihi237
Copy link
Contributor

Seem this issue only reproduce on the remote server.

@namhihi237
Copy link
Contributor

namhihi237 commented Jan 5, 2024

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

@situchan situchan mentioned this issue Jan 5, 2024
50 tasks
@namhihi237 namhihi237 mentioned this issue Jan 5, 2024
50 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jan 5, 2024
@mvtglobally
Copy link

Still repro on build 1.4.22-2

bandicam.2024-01-06.14-20-41-599.mp4

@thienlnam
Copy link
Contributor

We're handling this regression in this PR #34030

@thienlnam
Copy link
Contributor

Verified this is fixed on staging now

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jan 10, 2024
@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jan 10, 2024
@melvin-bot melvin-bot bot 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 Jan 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 10, 2024
Copy link

melvin-bot bot commented Jan 10, 2024

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

Copy link

melvin-bot bot commented Jan 10, 2024

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. 🎊

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 DeployBlockerCash This issue or pull request should block deployment Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

6 participants